I use Opera!

Limit number of tags in Wordpress

Aquarezz @ Netbuilders recently asked interesting question. How to limit number of tags shown in tag cloud on Wordpress powered sites. Well its very easy to limit or change the numbers if you decide to use some widget, but you can do it manually too. Only problem is that after Wordpress upgrade you will lose your modification, and you will need to do it again.

Here are steps how to do it:

1. Open the category-template.php

(it is located in the folder wp-includes)

2. Find this part of code in it

function wp_tag_cloud( $args = '' ) {
$defaults = array(
'smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'number' => 45,
'format' => 'flat', 'orderby' => 'name', 'order' => 'ASC',
'exclude' => '', 'include' => '', 'link' => 'view', 'taxonomy' => 'post_tag', 'echo' => true
);

its located under Display tags section…

3. Change the value ‘number’ => 45, to the number of desired tags

4. Save & refresh the page

That is it. Simple as I said.

No related posts.

Posted in wordpress — Hellas @ 8:27 am @ June 27, 2009

1 Comment »

  1. Hello,

    How made one to limit tags during the creation of an article? I would like to block the number of tags (5) to be put in the artcile. Sory for mi poor english ;)

    Thank you

    Comment by Communique de presse unique — February 10, 2011 @ 12:04 am

RSS feed for comments on this post. TrackBack URI

Leave a comment