The MU forums have moved to WordPress.org

Limit tag cloud text size? (5 posts)

  1. joshkadis
    Member
    Posted 14 years ago #

    I'd like to limit the largest font size in the default Tag Cloud widget, and it looks like the place to do that is in the 'largest' argument of the wp_generate_tag_cloud function around line 599 of wp-includes/categories-template.php

    But it doesn't seem to work when I clear my cache and refresh the site. I've also gone into Dashboard->Appearance->Widgets and resaved the Tag Cloud widget for good measure.

    Am I looking in the wrong place?

    Thanks.

  2. kgraeme
    Member
    Posted 14 years ago #

    Modifying the core files is a bad plan because it makes upgrade difficult.

    Try this tag cloud plugin
    http://wpmudevorg.wordpress.com/project/featured-blog-tag-cloud-widget-and-shortcode

    It lets you set font size, how many tags it shows, order alphabetically or by popularity, and even point to a different blog.

  3. andrea_r
    Moderator
    Posted 14 years ago #

    There's another better tag cloud widget out there in the WP plugin repo. Blanking on the name, but it has all kinds of extra tag cloud options.

  4. wssinfo
    Member
    Posted 14 years ago #

    Found this extremely easy.
    Via FTP or however you can edit pages on your server navigate to:
    /wp-includes/category_template.php

    Open with your editor of choice.

    Every "category_template.php" page will have a different number of lines depending on a number of factors, but for me it was on line 528.
    Look for this code snippet:

    function wp_tag_cloud( $args = '' ) {
    	$defaults = array(
    		'smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'number' => 45,
    		'format' => 'flat', 'separator' => "\n", 'orderby' => 'name', 'order' => 'ASC',
    		'exclude' => '', 'include' => '', 'link' => 'view', 'taxonomy' => 'post_tag', 'echo' => true
    	);

    Where 'largest' => 22, change that number to whatever font size you desire.

    There are a number of different arguments you can change there as well, but this worked for me.

  5. SteveAtty
    Member
    Posted 14 years ago #

    Yes but each time you upgrade WPMU you'll lose that change.

About this Topic

  • Started 14 years ago by joshkadis
  • Latest reply from SteveAtty