How To Display The Tags of Each WordPress Post From Your Theme’s Template File

Posted by admin 22 August 2011

To show the tags associated with a WordPress post from your template file automatically simply open the “single.php” template file from your theme and add the following line of code where you want to show the tags:

<?php the_tags('<strong>Tags: </strong>',' , '); ?>

The above code will display a list of the tags associated with the post in question separated by comma (,).

If you want to list each tag in its own line then use the following:

<?php the_tags('<strong>Tags: </strong>',' <br /> '); ?>

Related posts:

  1. How To Add Custom Content After Each Post In WordPress
  2. How To Randomize Post Order In WordPress
  3. HTML to WordPress: Header.php
  4. WordPress Theme Tweaking Cheat Seets
Tags: , , , ,

Leave your response!

You can subscribe to these comments via RSS.