• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WPArena

WPArena

WPArena is a premium online resource site of WordPress and is focused on providing excellent WordPress Tutorials, Guides, Tips, and Collections.

  • News
    • Opinion
  • Tutorials
  • Reviews
    • Themes
    • Plugins
  • Comparisons
  • Collections
    • Education Themes
    • Genesis Child Themes
    • Best Responsive Themes
    • Medical WordPress Themes
    • Finance & Business Themes
    • Crowdfunding Themes
  • Resources
    • Inspiration
  • Services
WPArena » Tutorials
Tutorials

How To Show Tags On A WordPress Theme

Avatar of Editorial Staff Editorial Staff April 25, 2009

Show Tags on WordPress Theme
FacebookTweetPinLinkedInEmailPrint

Since WordPress now has built-in tagging you might still need to add some code to older WordPress themes to get tags to show on your posts. Adding tags to your WordPress theme should be a pretty easy task.

There are numerous tagging plugins available that can do this for you. But if you want to control where the tags are shown on your WordPress blog then you might want to disable the plugins and edit the theme’s files to show the tags exactly where you want them to. The first and obvious file to add tags to is the single post template (single.php) file. The area to add the code to is typically at the end of the post (PHP the_content) and above and the comment section. In the example below I am showing the template tag in two different places. One is within the post meta data after the category and the other is on its own right before the comment section. The problem you might get into adding the tag code to the post meta-data is if you tend to use a lot of tags it could get to be a bit long and ugly. The code added below to show tags is:

https://gist.github.com/wpcount/41138628a85dd554c326f5604467bd1f#file-tags-php

and here is how it’s used in single.php

https://gist.github.com/wpcount/41138628a85dd554c326f5604467bd1f#file-single-php

To find the single.php file in the WordPress dashboard go to Appearance, Editor and click single.php on the right. If you don’t have a single.php file try index.php which is usually the main blogs page but may also be used on single posts for some themes. First, copy all the unedited theme code in the editor and paste it into a text file and save it for a quick backup in case you screw things up. Then find the correct location and paste in the tag code and save the file. Then check where the tags show. If you don’t like where they show, keep moving the code around and remember you might need to tag the post if the tags aren’t showing!

The above sample code is by no means the way it is going to be all themes and is only an example. Your theme might not look anything like the example above. And because of that, I couldn’t cover every theme variation. And please I can’t possible look at everyone’s theme code so please take some time to experiment with your theme.

Much more about WordPress template tags can be found on the Codex.

FacebookTweetPinLinkedInEmailPrint

Related Stories

  • We’re A Business Not A Charity

    We’re A Business Not A Charity

  • Best Tool For Automatic Social Bookmarking

    Best Tool For Automatic Social Bookmarking

  • How to Convert/Translate WordPress In Your Language

    How to Convert/Translate WordPress In Your Language

Avatar of Editorial Staff

Editorial Staff

Editorial Staff at WPArena is a team of WordPress experts led by Jazib Zaman. Page maintained by Jazib Zaman.

Reader Interactions

Share Your Thoughts Cancel reply

Before submitting your comment, we kindly ask that you read our comment policy. Your email address will remain confidential and will not be published or shared anywhere. If you subscribe, you will receive notifications regarding new comments.

Primary Sidebar

mistape-error-notification

Mistape: Best Free Error notification Plugin for WordPress

How to prevent access to WordPress Administration Menu items

Recent Topics

  • Official Windows 7 Wallpapers
  • How to secure your WordPress images and content from Theft
  • Top 20 Web Designing Companies in the World
  • WP Rocket Review: Is It the Perfect Solution for WordPress Caching?
  • The Complete WordPress Security Guide 2023 – Step by Step

Footer

Top

  • Services
  • Our Themes
  • Facebook
  • Twitter
  • Linkedin

Reviews

  • Beaver Builder Review
  • Beaver Themer Review
  • WP User Frontend Pro
  • Ninja Forms Review
  • MemberPress Review

More Reviews »

Resources

  • Best WordPress Plugins
  • WordPress Permalinks Structure
  • Email Management System
  • Envato Free Files
  • Advertise
  • Write for us
  • Disclosure
  • Terms
  • Privacy
  • Contact

Copyright © 2023 · All Rights Reserved · WPArena is a Project of TechAbout LLC.
We are not affiliated with Automattic or WordPress.

  • Advertise
  • Write for us
  • Disclosure
  • Terms
  • Privacy
  • Contact
Share this ArticleLike this article? Email it to a friend!

Email sent!