If your WordPress website has a lot of tags (and it’s growing), you can probably struggle with the messy list that looks bad in the WordPress tag cloud widget. However, you would rather show the decreasing number of tags instead of removing the widget, right?
Add the following code to your functions.php file:
1 2 3 4 5 6 7 | add_filter('widget_tag_cloud_args', 'tag_widget_limit'); function tag_widget_limit($args){ if(isset($args['taxonomy']) && $args['taxonomy'] == 'post_tag'){ $args['number'] = 10; } return $args; } |
To change the limit $args[‘number’] = 10; change the code.
Yorumlar