问题
I need to insert tags (of the post) inside post in the exact place. (default: they go after)
As I understand the only way is to use shortcode and write its description in functions. I think its an easy one including "print $tags_list", but I haven't managed to write the whole piece of code needed.
Can you help me? Or advise another way to solve my problem?
PS: Maybe another way is to insert tag code inside post, but wordpress editor doesn't understand
回答1:
You don't really need a shortcode unless the position changes per post.
To render tags in your template (you could just move the code):
<?php the_tags(); ?>
If you wanted to make a shortcode:
function sc_taglist(){
return get_the_tag_list();
}
add_shortcode('tags', 'sc_taglist');
And use [tags]
来源:https://stackoverflow.com/questions/28202455/wordpress-shortcode-for-tag-list