it feel like this should be easy. I want to add the post tags inside the body of some posts. I was thinking that creating a shortcode may be the answer. I came across these 2 pieces of code:
To display the tags…
<p><?php the_tags(); ?></p>
To create a shortcode…
function show_current_year(){
return date('Y');
}
add_shortcode('show_current_year', 'show_current_year');
I can’t combine the 2! Can anyone help? The only other solution would be to insert the php directly in the post but I think I’d need a plug-in to do that and I’m a bit wary.
Just add
the_tags()
to the shortcode: