• Resolved tiagozortea

    (@tiagozortea)


    Hello there,

    After 2.7 upgrade you can’t show more than 45 tags with the “number=” arg to wp_tag_cloud(); function.

    But I need it, now when I try more than 45 it returns a null array. I tried many plugins and hacks but all them seems to have the same problem, even those that say that can show more than 45.

    Anyone know how to remove that limit?

    Thanks,
    Tiago

Viewing 9 replies - 1 through 9 (of 9 total)
  • MichaelH

    (@michaelh)

    The argument number=0 is meant to show all tags with the Template Tag, wp_tag_cloud().

    Thread Starter tiagozortea

    (@tiagozortea)

    Thanks for the response MichaelH.

    Yeah it used to work, but not after 2.7. Now with number=0 it still returns a null array.

    I can confirm that number=0 definitely works on 2.7 for me.

    <?php wp_tag_cloud( array( 'number' => 0 ) ); ?>

    Are you passing in any other arguments?

    Thread Starter tiagozortea

    (@tiagozortea)

    Thanks Greenshady

    I am using 2.7.1 I don’t know if it matters.

    I found another forum post about that, it says that you really can’t show more than 45.

    https://en.forums.wordpress.com/topic/why-doesnt-show-my-tag-cloud-all-tags

    Im realy confused right now, I’m calling it exactly like you.

    That forum post has nothing to do with this. That’s about a widget on WordPress.com.

    I’d suggest deactivating plugins to see if something messing things up.

    Thread Starter tiagozortea

    (@tiagozortea)

    I tried disabling all the plugins also, the wierd thing is that any number lower than 45 make it work.

    I might be wrong but the widget use the same function and, therefore, has the same limitation, this is why I pointed it.

    /**
     * Display tag cloud widget.
     *
     * @since 2.3.0
     *
     * @param array $args Widget arguments.
     */
    function wp_widget_tag_cloud($args) {
    	extract($args);
    	$options = get_option('widget_tag_cloud');
    	$title = empty($options['title']) ? __('Tags') : apply_filters('widget_title', $options['title']);
    
    	echo $before_widget;
    	echo $before_title . $title . $after_title;
    	wp_tag_cloud();
    	echo $after_widget;
    }

    Well I thought that this limitation was known by the community, but if its not, some plugin might have screwed my data tables, I will keep looking after the source.

    MichaelH

    (@michaelh)

    The widget doesn’t have the ‘number=’ argument so it does default to 45 tags in the cloud.

    Thread Starter tiagozortea

    (@tiagozortea)

    I found the solution, but not the source.

    After several painfull hours of debug I found that one of my tags was messed up, it was showing normally on the web site, but when I tried to update or delete it I got a error message. Then I deleted it directly on the database.

    It worked.

    Tnx for all that helped.

    how do you do this in 2.8.4

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Showing all tags with wp_tag_cloud’ is closed to new replies.