fbpx
How to Show a WordPress Tag Cloud Anywhere on Your Site

How to Show a WordPress Tag Cloud Anywhere on Your Site

Some people use the tag cloud widget in WordPress to show their post tags on a widgetized sidebar but you can also manually add a tag cloud to your theme – which is perfect for creating a custom tag cloud page template or for adding them to your theme in areas that you don’t necessarily want widgetized. This WordPress code snippet will display a custom tag cloud anywhere on your site via your theme files.

Instructions
Add this code to your template files where you want the tag cloud to be displayed..

<?php wp_tag_cloud(array(
     'smallest' => 10, // size of least used tag
     'largest' => 18, // size of most used tag
     'unit' => 'px', // unit for sizing
     'orderby' => 'name', // alphabetical
     'order' => 'ASC', // starting at A
     'exclude' => 6 // ID of tag to exclude from list
     ));
?>

WordPress Snippet Info

Tested with Wordpress v. 4.8
Last Modified: 15.05.2018
Last Reviewed: 15.05.2018

How to Show a WordPress Tag Cloud Anywhere on Your Site
4.5 (89.23%) 13 vote[s]
Please report broken snippets.
Report Broken Snippet
WordPress Hosting - WP Engine

Recent Comments