• Hi,

    Can anyone help me how to filters tags in the widgets tag cloud sidebar, I have found a little code that do that, but insteaded is filtering the category. This is what I have in my functions.php:

    add_filter( ‘widget_tag_cloud_args’, ‘my_function_tags’);
    function my_function_tags( $args ) {
    $args[ ‘exclude’ ] = array(1, 2, 8, 13);
    return $args;
    }

    Thank you in advance.

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    There’s some other filter callback somewhere telling the widget to use categories. Ideally, you ought to find it and remove it. That can be quite a search. You can simply override the other code. Add a third priority argument to add_filter() that’s an integer larger than 10 (the default). Thus your code will run after the other, overriding it.

    Add $args['taxonomy'] = 'post_tag'; to your callback.

Viewing 1 replies (of 1 total)
  • The topic ‘WP tag cloud’ is closed to new replies.