I got the “Most Popular Tags” wordpress plugins so I can display the tags on my site, but it displays a bunch of general tags. Is there any code I can add that will allow me to display the most popular tags on my site with the option of excluding the tags I don’t want? Or a plugin that allows this?
Leave a Reply
You must be logged in to post a comment.
The solutions I see involve writing custom queries or plugins. While you asked about a specific plugin, know that this can be done through pure WP. Here are two options:
First, you can create a tag cloud using
wp_tag_cloud
and sort it bycount
, as such:You can exclude certain tags from using the
exclude
parameter. You can also customize the font size output, or simply use CSS to ignore the tag cloud font sizes.Another option is to use
get_terms
, which can be used as such:I personally am a fan of the second,
get_terms
option. Like withwp_tag_cloud
, you can pass a list of ids to exclude through theexclude
parameter.This code will return the most used tags on the last 30 days. With a little bit of jQuery and CSS you can customize to, for example, put a large font-size on the first one and a small font-size on the last one.
I think the get_tags->count does not really count the tags in a range. I have implemented this solution, please let me know if this works for you: