Sometimes you may want to limit the tags in WordPress tag cloud widget because your site have lots of tags. To limit the tags you only need to add the following function to your function.php file.

 

function tag_cloud_limit($args) {

	if ( isset($args['taxonomy']) && $args['taxonomy'] == 'post_tag' ) {
		$args['number'] = 16; // Number of tags to show
	}

	return $args;

}
add_filter('widget_tag_cloud_args', 'tag_cloud_limit');

 

Muhammad Zohaib

Hello, I am a Web Developer who loves building, editing and extending WordPress themes and plugins ;-)

Leave a Reply

Your email address will not be published.