Modify tag cloud widget font size

WordPress’s tag cloud widget has three different font sizes, the default, the smallest and the largest. These are applied to tag cloud links based on the number of items attached to each tag.
If you want to modify these sizes you need to add this bit of code at the bottom of the theme’s functions.php file

add_filter('widget_tag_cloud_args','set_tag_cloud_sizes');
  function set_tag_cloud_sizes($args) {
    $args = array('smallest'    => 12, 'default' => 16, 'largest'    => 20, 'unit' => 'px');
    return $args;
}

modify the values of the ‘smallest’, ‘default’ and ‘largets’ attributes and save.

Notice: If the functions.php ends in a PHP closing tag ?> you paste the code just above it.

No votes yet.
Please wait...

Get 30% Off! Coupon code: WORDPRESS - Join Today!