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


<?php
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

This site uses Akismet to reduce spam. Learn how your comment data is processed.