WordPress.org

Ready to get started?Download WordPress

Forums

Limit tags in tag cloud (7 posts)

  1. Nairolf_fr
    Member
    Posted 5 years ago #

    "Hello World",

    I would like to customize the default tag cloud so that a tag doesn't show in the cloud if it's not popular (i.e. used at least in a given number of posts). This way, I won't show tags less used than x times.

    Another question is, where can I change the font size for this tag cloud ?

    Any suggestion of a new plugin for tag cloud that allows these hacks isg reatly appreciated.

    Thanks !

  2. dtwilliamson
    Member
    Posted 5 years ago #

    To change the font sizes, edit wp-includes/widgets.php using information found at:

    wp_tag_cloud

    basically, you want this:

    wp_tag_cloud('smallest=8&largest=22');

    substituting the sizes you want.

  3. Saurus
    Member
    Posted 5 years ago #

    And stop making 3 posts on the same issue.

  4. jdybka
    Member
    Posted 5 years ago #

    Did you find out how to limit the cloud (your 1st question)?

    I am also interested in limiting the tag cloud display to something like show only those tags used in < x posts.

  5. Wes
    Member
    Posted 4 years ago #

    Actually wp_tag_cloud is found in: wp-includes/category-template.php. You can change the font-size just like dtwilliamson noted above.

    @Nanarolf_fr - You may be able to do what you're trying to in wp-includes/category-template.php, however I just minimized the number of tags in my tag cloud. You'll find that on the same line as the line you need to edit to change the font size. I just wrote this blog post about it.

  6. gsawiris
    Member
    Posted 4 years ago #

    what do you type in the widget box to limit the number of tags?
    i tried

    number=20

    and some other strings but nothing works

  7. bonx
    Member
    Posted 4 years ago #

    wp-content/themes/yourstyle/sidebar.php

    <?php wp_tag_cloud('smallest=8&largest=14&number=12&'); ?>

    I don't use widgets but add code to sidebar.php for versatility so it may not help but full code to add tags is:

    <li>
    <h2>Tags</h2>
    <ul>
    <?php wp_tag_cloud('smallest=8&largest=14&number=12&'); ?>
    </ul>
    </li>

    small text size 8
    largest 14
    number of tags 12

Topic Closed

This topic has been closed to new replies.

About this Topic