Tag Cloud Widget: Most Popular Tags Only
Limits the Tag Cloud widget and block to your most used tags and orders them by popularity, so the cloud stays readable on sites with hundreds of tags.
Opens WPIDE on
Code
// Number of tags to show.
$wpide_tag_cloud_number = 20;
add_filter( 'widget_tag_cloud_args', function ( $args ) use ( $wpide_tag_cloud_number ) {
$args['number'] = absint( $wpide_tag_cloud_number );
$args['orderby'] = 'count';
$args['order'] = 'DESC';
return $args;
} );
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.