Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'widget_tag_cloud_args', 'edit_cloud_tags', 10, 4 );
- function edit_cloud_tags( $args, $instance ) {
- $popular_tags = get_terms(
- array(
- 'taxonomy' => 'post_tag',
- 'orderby' => 'count',
- 'order' => 'DESC',
- 'number' => 10, /* the number of tags list you want to show */
- )
- );
- $tag_list = array();
- foreach ( $popular_tags as $popular_tag ) {
- $tag_list[] = $popular_tag->term_id;
- }
- $args['include'] = $tag_list; /* show onky the included tags id */
- return $args;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement