How to add something after the post?
-
I am trying to display terms of my custom taxonomy below the posts. I can add
<?php the_terms( $post->ID, 'people', 'People: ', ', ', ' ' ); ?>
But I want to add it to my child theme’s functions.php file so that no matter which theme I use the terms get displayed below the post.
I know about action hooks and I think I can hook this with the_content I tried this code
function my_terms($content) { $terms .= the_terms( $post->ID, 'people', 'People; ', ', ', ' ' ); ; return $content.$terms; } add_action('the_content', 'my_terms');
It works but it adds terms between post content and title. I would like the terms to appear after the content. Can someone please tell me how I can do this?
Thanks
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘How to add something after the post?’ is closed to new replies.