Website Scripts And Cloud Tutorials

How to Display Tags in WordPress

Byadmin

Dec 22, 2013
migrate GD star to YASR plugin in WordPress

Last updated on January 23rd, 2022 at 09:15 am

Click to rate this tutorial!
[Total: 0 Average: 0]

Display Tags in WordPress without plugin

A very simple way to add the tags on to a WordPress theme without plugin.Just add the code below lines to the file you want it to appear, preferably SIDEBAR.PHP or anywhere in your website header/footer or main.

Displaying of tags in WordPress can be easily done using function  wp_tag_cloud() 

Here the smallest means the FONT size of the category where least number of post have been made,

Largest means FONT size of category where the most number of posts have been made.

<?php wp_tag_cloud('smallest=8&largest=36'); ?>

You can use CSS to make it look elegant. Style the links using the code below

<style>
a:link, a:visited {
  background-color: white;
  color: black;
  padding: 10px 20px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
}

a:hover, a:active {
  background-color: grey;
  color: brown;
}
</style>

Demo

Click to rate this tutorial!
[Total: 0 Average: 0]
2 thoughts on “How to Display Tags in WordPress”
  1. Great to know that it required such an small code for getting such useful information.Thanks for sharing.

Leave a Reply

Your email address will not be published.