Support » Fixing WordPress » Same text size in Tag Cloud

  • Resolved YOTS

    (@yots)


    I’m trying to get a list of all my tags to display in the same font size no matter how often a tag is being used. I set the smallest and largest parameters but the tags are still different sizes. Here is the code I used:

    <?php wp_tag_cloud('smallest=1&largest=0&unit=em&number=0&format=list'); ?>

    Anyone know how I can easily get all the tags to show the same size? Thanks.

Viewing 10 replies - 1 through 10 (of 10 total)
  • You’re not going to be able to do that with the Template Tag, wp_tag_cloud(), because if I’m reading the code correctly there is always a ‘spread’ between the font sizes. Look in the line 340 of wp-includes/category-template.php. So try this:

    <?php
    $tags = get_tags( array('orderby' => 'count', 'order' => 'DESC') );
    foreach ( (array) $tags as $tag ) {
    echo 'tag name '.$tag->name . 'tag count '. $tag->count;
    }
    ?>

    Michael thanks. That didn’t seem to work. This is what it generated:

    tag name gridtag count 4tag name templatetag count 1tag name indesigntag count 1tag name tooltag count 1tag name filetag count 1tag name typographytag count 1tag name quotestag count 1tag name punctuationtag count 1

    Yes that’s the tag name and tag count for every tag. I’ll leave it to you to style it accordingly.

    How would I style that it? Through CSS? I don’t see any ids or classes.

    Maybe you’ll like this more better

    <?php
    $tags = get_tags( array('orderby' => 'count', 'order' => 'DESC') );
    foreach ( (array) $tags as $tag ) {
    ?>
    <div class="navigation">
    <?php echo '<a href="' . get_tag_link ($tag->term_id) . '" rel="tag">' . $tag->name . '</a>';	?>
    </div>
    <?php		}
    ?>

    Michael, you’re a damn genius. That is perfect. Thanks so much for all the help. Very much appreciated.

    Genius at stealing code from core 😉

    Thanks

    I want to do the same thing. Where do I make this change? I’m using the iNove theme.

    Ignore my question, I see you gave a file name in your original answer: wp-includes/category-template.php

    Hey… this realy works. Check it out at my poker blog Realz thank you, untyl now looked crapy but now it’s ok. Thanks

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Same text size in Tag Cloud’ is closed to new replies.