How to get post tags and categories

Many times you might need to display post tags or categories along with the post. This can be achieved by using following code

echo get_the_tag_list('<p>Tags: ',', ','</p>');

If you are using custom taxonomy, you can use following code

<?php echo get_the_term_list( $post->ID, 'modernquotetaxonomy', 'Tags: ', ', ' ); ?>

Leave a Reply

Your email address will not be published. Required fields are marked *