Skip to:
Content
Pages
Categories
Search
Top
Bottom

Change font size range for tag cloud

  • @tbronson

    Member

    I’m trying to change the font size range in the tag cloud. So far, I changed “largest” from 24 to 16 in three functions, bb_get_tag_heat_map, bb_related_tags_heat_map, bb_tag_heat_map in template-functions.php, but the site display has remained the same.

    What have I missed?

    Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)
  • @chrishajer

    Participant

    @tbronson

    Member

    Thanks, chrishajer, this…

    <?php tag_heat_map( 8, 16, ‘pt’, 100); ?>

    …worked, putting the parameters in the template tag, although I don’t know why, ’cause the default values seemed to be changed in the function in template-functions.php. But, I don’t care why, either, since it works!

    @przwilson

    Participant

    These responses are from many years ago and those files don’t seem to exist any more. Is it still possible to change the font size of the bbPress tag cloud? I’ve been trying various functions but cannot get it to work, and I’ve tried searching through the bbPress files for bb_tag_heat_map but cannot find that anywhere.

    The default font sizes are too big and the tags are hanging of the page of our forum. If someone can please help me to change the maximum font size for the tag cloud it would be most appreciated.

    Thanks you!

    @hbombs86

    Participant

    Just thought I’d reply to przwilson:
    I had the same problem and spent an entire day looking for the code. But I just found it.

    IT’s at bbpress/includes/common/shortcodes.php

    Around line 522 for me you’ll see the “largest” and “smallest” stuff. Edit it there and your problem is fixed. All you need to do is change the numbers.

    Cheers.

    @przwilson

    Participant

    Dude this is awesome, thank you!

    You’d think there would be a function we could use to get this to work, so that we aren’t up *$%#’s creek if they change the files again in a future update.

    Anyway much appreciate it, this is really helpful. Good karma to you sir…

    @batmanfan

    Participant

    @hbombs86, you are good! thank you. This is what I did…

    // Output the topic tags
    		wp_tag_cloud( array(
    			'smallest' => 11,
    			'largest'  => 20,
    			'number'   => 80,
    			'taxonomy' => bbp_get_topic_tag_tax_id()
    

    however, the font size only show 11 on all – same size. Did I do something wrong? I thought it would randomly display 11 to 20?

    @batmanfan

    Participant

    Perhaps fonts shown in different colors will be even better.

    @ailyroot

    Participant

    just want to add that

    editing bbpress/includes/common/shortcodes.php method resolve our problems of cloud size is too big

    @robkk

    Moderator

    You can use the tag cloud widget, select the taxonomy to be topic tags, then use this PHP function in your child theme or in a functionality plugin.

    add_filter('widget_tag_cloud_args','set_tag_cloud_sizes');
    function set_tag_cloud_sizes($args) {
    $args['smallest'] = 12;
    $args['largest'] = 19;
    return $args; }
Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.
Skip to toolbar