WordPress Tag Cloud is a great way to display a list of different categories or tags all over your website. Using these type of tag clouds placed on the sidebar of your website, users can reach the exact place which they are searching for. If you are a little geeky and want to create your own Tag cloud on the website. Apart from that, the tag cloud will provide a visually appealing way of proclaiming your expertise in different areas of your domain. Let’s see more about WordPress tag clouds and how to implement them.
What is a WordPress Tag Cloud?
WordPress tag cloud is a list of taxonomies arranged in such a way that uses can easily click on them to navigate to their respective archives. These tag clouds are a great way to showcase the structure of your website and the most significant section the users might be looking for. There are different parameters for the tag cloud functionality provided by WordPress in its core. You configure them according to your requirements, including the styling to make it match the styling of WordPress theme.
Methods to Create a Tag Cloud
There are multiple ways that you can use to create a tag cloud on WordPress. Some of them are listed below.
Method 1. Using the block editor
If you are using the latest versions of the WordPress, you can simply use the Tag Cloud Block available all across the block editor. You can simply place it anywhere and configure accordingly.
Method 2. Using the wp_tag_cloud function
To create or display a new tag cloud. Paste the below code to the theme file where you want to display the tag cloud in your website. Read the WordPress.org Tag Cloud Reference if you need to know more about tag clouds.
<?php
wp_tag_cloud(array(
'smallest' => 8, // size of least used tag
'largest' => 22, // size of most used tag
'unit' => 'px', // unit for sizing the tags
'number' => 45, // displays at most 45 tags
'orderby' => 'name', // order tags alphabetically
'order' => 'ASC', // order tags by ascending order
'taxonomy' => 'post_tag' // you can even make tags for custom taxonomies
));
?>
Method 3. Using a tag cloud plugin.
Like any other functionality in WordPress, there are tag cloud plugins available all over the WordPress plugin repository. You can use anyone of them to display tag clouds on your WordPress websites. One such plugin is Cool Tag Cloud.
Style the Tag Cloud
Styling can be done in any way as you wish, If you know all the basics of the CSS, you can easily tweak the look and feel of the tag cloud. The image shown below is such an example.
To get this design for the tag cloud, use the following CSS code. If you are unsure how to place it, have a look at editing CSS in WordPress.
.tagcloud a {
display: block;
float: left;
padding: 4px 10px;
margin-right: 7px;
margin-bottom: 7px;
background: #eee;
color: #666;
font-size: 11px;
font-weight: bold;
text-transform: lowercase;
text-shadow: 1px 1px 1px #fff;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
border: 1px solid #ccc;
text-decoration: none;
}
.tagcloud a:hover {
background: #f3f3f3;
color: #000;
text-decoration: none;
}