We can add a tag cloud widget for our wordpress website, however, tags displayed in wordpress tag cloud widget are not ordered by their post counts. In this tutorial, we will implement to display and order tags in tag cloud widget with their post counts.
Open your theme functions.php
Add code below in functions.php
function set_widget_tag_cloud_args($args) { $my_args = array('orderby'=>'count', 'order'=>'DESC' ); $args = wp_parse_args( $args, $my_args ); return $args; } add_filter('widget_tag_cloud_args','set_widget_tag_cloud_args');
Save file, then you will find tags in tag cloud widget are displayed by their counts, from big to small.