Add category, tag and time data to your WordPress post template

Find out how to add your post’s categories, tags and the time your post went live to your WordPress template.

Adding categories, tags and the time a post was posted is all useful stuff to know. Here’s how it’s doneā€¦

<?php the_tags('<div class="tags">Tags: ', ', ', '</div>'); ?>

Returns: Tags: Apples, Pears, Bananas (if you have Apples, Pears and Bananas as tags!!!)

<?php the_category(', '); ?>

Returns: Tags: Fruit, Vegetables, Meat

<?php the_time('jS M Y'); ?>

Returns: 1st Mar 2014

More information and how to extend these further can be found at WordPress: the_tags, the_category, the_time and PHP Date

Leave a Reply

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