how to add tag cloud to wordpress theme

how to add tag cloud to wordpress theme

WordPress tags and tag cloud is important part in wordpress theme. Here in article given code to add tag cloud to wordpress theme. Tag cloud good for SEO.

I will give so much credit to tags and tag cloud because SEO prospective tag are important.

how to add tag cloud to wordpress theme

What is a tags and Tag cloud?

This is the process of adding keywords which link directly to a site that monitors and allows search of key tags to find information on websites and blogs.

Tag cloud are also same but that will attract the users and give more information about topics which write in your blog. Keep this in mind tag are really important for SEO.

In this article I will show how to create the beautiful tag using wordpress api.

In your template you will found the single.php and page.php or index.php files in that file, You are already using some loop for fetching the posts. In that loop just put following code for displaying the tags.


the_tags( $before, $separator, $after );

<php the_tags();?>

Now comes interesting part,  adding a tag cloud to your sidebar or footer.

Using following code you can display the tag could but don’t put following code in any loop.


<!--?php wp_tag_cloud('smallest=8&largest=22'); ?-->

If you want to show tag cloud more interesting than use my code in your style.css file.


.tags{
 clear:both;
 background:#FAFAFA bottom;
 margin:10px 0 10px;
 padding:12px 10px 15px 10px;
 -moz-box-shadow:0 2px 2px rgba(0, 0, 0, 0.2);
 width:auto;
 margin-bottom:5px;
 width:304px;
 border:1px solid #cfdcc7;
}

.tags a:link,.entry a:visited {
 font-weight:normal;
 color:#356BB2;
}
.tags a:hover {
 background:#356BB2;
 color:#fff;
 font-weight:normal;
 text-decoration:none;
}

Your tag cloud will look like..as follows.

how to add tag cloud to wordpress theme
how to add tag cloud to wordpress theme

you can pass following param to tag_cloud function.


More help full function tag related as follows:

the_tags, tag_description, single_tag_title, wp_tag_cloud, wp_generate_tag_cloud, get_tags, get_the_tags, get_the_tag_list, get_tag_link

You can visit the pages and check the details.

Published by

Purab

I am Purab from India, Software development is my profession and teaching is my passion. Programmers blog dedicated to the JAVA, Python, PHP, DevOps and Opensource Frameworks. Purab's Github Repo Youtube Chanel Video Tutorials Connect to on LinkedIn

Leave a Reply

Your email address will not be published.