Hey,
I'm currently using
<h3>Tags</h3>
<?php wp_tag_cloud('largest=48'); ?>
I was wondering how I can apply "largest=48" via Functions.php to all calls of the tag-cloud on the sidebar?
Something like:
FUNCTION if: tag_cloud add: 'largest=48'
Lou
Does anyone have any ideas? any code gurus out there?
(edit: this might reset all other parameters to default)
for the default cloud widget:
add_filter('widget_tag_cloud_args','set_largest_tags');
function set_largest_tags($args) {
$args = array('largest' => 48);
return $args;
}
edit 2: you can add multiple parameter into the array.
http://codex.wordpress.org/Plugin_API/Filter_Reference
"this might reset all other parameters to default"
Is this a bad thing? you mention "all other parameters" are you referring to just the tag-cloud parameters?
Either way, this got the job done :)
Thanks so much, alchymyth.
Lou
well done ;-)
Is this a bad thing? you mention "all other parameters" are you referring to just the tag-cloud parameters?
this is just referring to the tag cloud parameters; however, the good thing is that you can set as many parameters as you need to change.
wagonlips
Member
Posted 1 year ago #
This code works equally well to limit the number of tags displayed in the cloud with only minor changes:
add_filter('widget_tag_cloud_args','set_number_tags');
function set_number_tags($args) {
$args = array('number' => 20);
return $args;
}
Thanks, alchymyth