How to show tags under post content in WordPress

If for some reason your theme does not show post tags, or you’re designing a custom theme and are wondering how to display the tags this how-to is for you. This is an update of the original article, with some updates on the code and the way it is hooked.

  1. Make the HTML and CSS Markup for the tags
  2. Figure out where to hook your code
  3. Load your files
  4. Design and hook your function to the appropriate action

Make the HTML and CSS Markup for the tags

I’ll be using the following css for the tags:

having this ready, the html will be as follows:

Figure out where to hook your code

Reading through the hooks and filters I’ve decided to use the “the_content” filter this time. That way you can add your tags either before or after the post content.

Load your files

Now lets add our tags css the proper WordPress way using “wp_enqueue_style“:

Design and hook your function to the appropriate action

Now we have all the pieces we need, lets get them all together.

Now all you have to do is add the code from the link below to your functions.php upload the css in “/path/to/your/theme/css/tags.css” and you’ll have the tags under each post content without the need to edit any templates.

You can download the code for this how-to in

About Pavel Petrov 2 Articles |  17 How-tos

Pavel is a senior developer for the last 7 years, with extended interest in Linux administration, WordPress and Symfony.


Be the first to comment

Leave a Reply

Your email address will not be published.


*