ThemeShaper Forums » Thematic

[closed]

Increasing the number of tags in the cloud

(9 posts)
  • Started 10 years ago by redhatgal
  • Latest reply from jdcohan
  • This topic is resolved

Tags:

  1. redhatgal
    Member

    Hi, I had noted that my tag cloud was not increasing with new tags so I researched and learned the culprit might be that the template tag wp_tag_(cloud) restricts the number of tags that can be displayed. I don't know for sure if this template tag is being used in this Theme which I am using because I haven't been able to locate it. Can someone tell me which file this template is located? It's not in widgets.php.

    If the issue is something different, please enlighten me. Thanks!

    Amy

    Posted 10 years ago #
  2. redhatgal
    Member

    Hello? Anyone here?

    Posted 10 years ago #
  3. Yep .. Don't have any quick solution to change the number of tags other than:

    - write your own widget
    - write your own action using wp_tag_cloud
    - use one of the plugins from WordPress Plugin Directory like Simple Tags

    Chris

    Posted 10 years ago #
  4. redhatgal
    Member

    Hi Chris, thanks for answering and for the suggestions. But, since the tag widget was already part the Thematic theme when I started using it, I like to know where the source is located. I haven't been able to find it among the files in the thematic theme directory. I realize I could replace the current version with Simple Tags, but it doesn't make sense not to modify the one I already have. I'm comfortable enough with PHP.

    Posted 10 years ago #
  5. redhatgal
    Member

    Thanks to a hint found in WP forums, I found the wp_tag-cloud template inside the wp-includes/category-template.php. I changed the 'number' => 45 to 'number' => 0 and this solved my problem.

    Posted 10 years ago #
  6. wpnoob
    Member

    @redhatgal, did that allow you "unlimited" tags to be displayed? I use simple-tags but would welcome using less plugins.

    Posted 10 years ago #
  7. I know that this can be done by changing WP files. But this is not recommended! You will loose these changes during the next WP update / upgrade and you might (not with this change) create security issues or others. And you won't get any type of support for a 'hacked' WP version.

    If you don't want to use an additional plugin there's still the option to create a function using wp_tag_cloud() and hook it into one of the sidebar action hooks.

    Chris

    Posted 10 years ago #
  8. redhatgal
    Member

    wpnoob, yes, changing the number to 0 allows all active tags to be displayed.

    Chris, good points. I did not consider using the updates. I will look into creating a function using the cloud or using Simple Tags.

    Posted 10 years ago #
  9. jdcohan
    Member

    @chris wrote:
    > If you don't want to use an additional plugin
    > there's still the option to create a function
    > using wp_tag_cloud() and hook it into one of
    > the sidebar action hooks.

    Exactly what I want to do. In my case, I want to simply change the value of the "largest" argument in the wp_tag_cloud() function.

    So the question is: How?

    I'm thinking I add something like this to the functions.php of my child theme:

    function tag_cloud_reformat() {
    // code here to set 'largest' to 14;
    }
    add_action('wp_tag_cloud', 'tag_cloud_reformat');

    Am I getting warm?

    Posted 9 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.