Change wp_tag_cloud() argument values using hook
-
I’m using a child theme of the Thematic theme framework, but I think this is a general question.
GOAL: I want to modify the values of some of the wp_tag_cloud() function arguments. Let’s suppose I simply want to change the value of ‘smallest’ to 10 and ‘largest’ to 14.
I do not want to touch the core function in category_template.php.
Thematic has all of its proprietary hooks in its template files, so I don’t see where I would hard-code the wp_tag_cloud() function without disrupting things that work.
So I figure I can/should create a function in my child theme’s functions.php file. I think I need to use either add_action(), add_filter() or apply_filters() to make this happen. I think I might need to use remove_[action | filter](), too.
But that’s all I (think I) know. None of my many different stabs worked.
One stab was this (the result is echoing “Array” where the tag cloud should be):
function tag_cloud_reformat() {$args = array('smallest' => 10, 'largest' => 14);
return $args;
}
add_filter('wp_tag_cloud', 'tag_cloud_reformat');Help would be much appreciated.
Jeff
- The topic ‘Change wp_tag_cloud() argument values using hook’ is closed to new replies.