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 the theme’s functions.php file

  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.

For a limited time, take 30% off. Use code at checkout: WORDPRESSBuy Now