[wp-testers] WP Tag Cloud parameter question...

Pål Grønås Drange paal at drange.net
Wed Jun 27 18:32:58 GMT 2007


spencerp wrote:
> I had asked about this before, and was trying to find that someone's 
> reply post in the archives but couldn't off hand. It's regarding the 
> WP Tag Cloud.
I recently saw a bug for this specific function, but I don't think that
has anything to do with this (http://trac.wordpress.org/ticket/4549)
> I'm using this for sidebar.php file for theme:
> 
> <?php wp_tag_cloud('smallest=8&largest=22'); ?>
> 
> But what's the code to include to that, to display only a set amount 
> of WP tags, rather then ALL of them on the sidebar? Mr. Jeremy Visser
>  thought the "number" parameter is what I'm after, but he says it's 
> not working either..
It should be <?php wp_tag_cloud('number=42&orderby=count'); ?>

> "However, it doesn't work, and if you look inside the 
> wp_generate_tag_cloud() function, it doesn't even touch $number. So, 
> I presume the WP guys haven't implemented it yet."
It touches number with the function wp_parse_args ( line 1288 in
wp-includes/functions.php ) and again in wp_generate_tag_cloud.

I do not know much this topic (hell, I don't even know what that
function does, nor the wp_parse_args (except merging two arrays)), so
you should listen to what others say. Neither do I know PHP to well (and
if someone can tell me why they use $args = '' as parameters in a
function I will be very happy.

--- pgdx


More information about the wp-testers mailing list