Limit number of tags in WordPress tag cloud widget
Default limit of tag cloud widget in WordPress is 45. If your WordPress website has a lot of tags and continuously growing, you may probably struggle that all of your tags not visible in WordPress tag cloud widget.
Or may be in some case you want to show specific number of tags in tag cloud widget. With the help of this simple hook you can manege your number of tag in tag cloud widget.
1 2 3 4 5 6 7 8 9 10 11 12 |
//Register tag cloud hook add_filter('widget_tag_cloud_args', 'tag_widget_numbers-limit'); //Limit number of tags inside widget function tag_widget_numbers-limit($args){ if(isset($args['taxonomy']) && $args['taxonomy'] == 'post_tag'){ $args['number'] = 20; } return $args; } |
Copy and paste this code inside your theme functions.php file.
[paypal-donation]