How to modify the display quantity of WordPress tags?

Publish: 2014-11-17 | Modify: 2014-11-16

WordPress default displays 45 tags by default. However, if our theme enables colored cloud tags or bold display, it may look awkward. Therefore, we need to reduce the number of displayed tags, which is actually quite simple.

Go to the wp-includes/category-template.php directory and find around line 524 (in my WordPress 3.8, it's at line 524). Alternatively, you can directly search for the keyword <span style="color:red;">wp_tag_cloud</span> to find it. Then, we will see <span style="color:red;">'number' => 45</span>, which is the default number of tags to display. You can modify it to the desired number according to your theme. For example, on my blog, I modified it to only display 25 tags.

wp_tags
Modify the number of tags

Similarly, if you want to display more tags, simply modify the number to be greater than 45.


Comments