Knowledge Base

Modify tag cloud widget font size

WordPress  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 your child 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.

Use the coupon code SAVE30 and save 30% OFF! Buy Now