Find out how many tags are in a group (3 posts)

  1. scalare
    Posted 2 years ago #

    I need to display a tags cloud for a tags group (as list, not cloud) that has to be split in two parts. The first part will have 5 tags, and then I have to display a "see all" link that when clicked, displays the rest of the tags in that group. So far, everything works fine. The problem is that if there are 5 or less tags in the group, I shouldn't display the "see all" link at all, since it won't display anything.

    Is there a function in your plugin that would let me find out how many tags are in a group, so I know if I have to display the "see all" link in case that number is bigger than 5?

    Thank you in advance.


  2. scalare
    Posted 2 years ago #


  3. scalare
    Posted 2 years ago #

    I've figured out. Since the template tag uses the same parameters as wp_tag_cloud(), I called it using format=array&echo=false, and assigned it to an array. Then I just asked for the array length to figure out if it was bigger than 5.

    I hope this helps somebody.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • xili-tidy-tags
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic