• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

How can you change the font-size range in the tag cloud via functions.php?

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › How can you change the font-size range in the tag cloud via functions.php?

This topic is: resolved

Tagged: Eleven40, font size, tag cloud

  • This topic has 7 replies, 4 voices, and was last updated 10 years, 7 months ago by babrees.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • April 2, 2013 at 2:49 am #32591
    Chris Moore
    Member

    Hello,

    I tried changing the font-size in the tag cloud widget for the eleven40 child theme to no avail. It turns out that when you use the WordPress tag cloud widget you cannot alter the font-size via CSS. I don't want to use yet another plugin my friends, so would someone be so kind as to give me the exact php function and code snippet that I could use in my eleven40 child theme's functions.php file so that I can make the tag cloud font-size range go from 8pt up to 10pt (instead of up to 22pt, which is what it is right now).

    Thanks!

    ~ Chris


    Resepctfully, Chris Moore
    Web Dev, CSS Hacks, & Biz Consulting @ MooreCreativeIdeas.com / Blogging @ ReflectOnThis.com

    April 2, 2013 at 4:20 am #32599
    Chris Moore
    Member

    Solution City! I figured it out from this short tutorial here: http://chris.dziemborowicz.com/blog/2009/06/11/change-the-tag-cloud-font-size-in-wordpress-2-8/

    I just used the short code snippet he shared and placed it in my child theme's functions.php. I ignored the suggestion of making it into a plugin.

    Here's the code snippet I used in my child theme's functions.php:

    function tcr_tag_cloud_filter($args = array()) {
    $args['smallest'] = 8;
    $args['largest'] = 12;
    $args['unit'] = 'pt';
    return $args;
    }

    Followed by:

    add_filter('widget_tag_cloud_args', 'tcr_tag_cloud_filter', 90);

    Anything I need to lookout for or be aware of? Is there a "better" way to do this?

    Thanks everyone!

    ~ Chris M.


    Resepctfully, Chris Moore
    Web Dev, CSS Hacks, & Biz Consulting @ MooreCreativeIdeas.com / Blogging @ ReflectOnThis.com

    April 2, 2013 at 4:38 am #32600
    Chris Moore
    Member

    Here's an even shorter and "cleaner" way to do it (sharing for those who might find this thread):

    http://wordpress.org/support/topic/different-font-sizes-for-tag-clouds#post-2948370

    Here's what I ended up using for my purposes (I wanted it to be 8pt - 11pt in size):

    add_filter('widget_tag_cloud_args','set_tag_cloud_sizes');
    function set_tag_cloud_sizes($args) {
    $args = array('smallest' => 8, 'largest' => 11);
    return $args;
    }


    Resepctfully, Chris Moore
    Web Dev, CSS Hacks, & Biz Consulting @ MooreCreativeIdeas.com / Blogging @ ReflectOnThis.com

    October 2, 2013 at 11:57 am #65090
    bello-via
    Member

    Very helpful. Thanks for updating the post with the code you used. Worked perfectly!

    October 2, 2013 at 12:00 pm #65091
    Chris Moore
    Member

    Hello @bello-via,

    That's great! So glad it worked out for you. I can't count the number of times I have posted a question (here and elsewhere), only to just figure it out myself and post the answer. LOL...

    Have a great day!


    Resepctfully, Chris Moore
    Web Dev, CSS Hacks, & Biz Consulting @ MooreCreativeIdeas.com / Blogging @ ReflectOnThis.com

    December 19, 2013 at 11:12 am #80237
    Mealtog
    Member

    Nice, just got this to work Chris. Is there a way to add the number of tag items in () beside each tag?

    December 19, 2013 at 2:13 pm #80306
    Chris Moore
    Member

    Thanks @mealtog! Unfortunately, I don't have something ready-made for that. However, this may help you in your quest: http://dmblog.com/wordpress-tag-cloud-with-post-counts/


    Resepctfully, Chris Moore
    Web Dev, CSS Hacks, & Biz Consulting @ MooreCreativeIdeas.com / Blogging @ ReflectOnThis.com

    December 1, 2014 at 9:50 am #133337
    babrees
    Participant

    Thanks for this - just what I was looking for, works a treat!

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble