Different Styling for Assigned Tags

The parameter tags_post_id has been around now for a while, helping you to display only tags that are assigned to a particular post or page (depending on the value, where 0 means the current item).

In response to a request, I have now created a new version (0.16) with another useful option: Rather than hiding unused tags, they receive a different class and can therefore be styled differently using assigned_class. 1

Two examples, each with the used shortcode on top:

[tag_groups_cloud tags_post_id=0 assigned_class=tag_assigned]


While testing, I thought it would be useful to have also the option to force displaying all groups. Better add it now than having to dig into the code again in a few weeks…

[tag_groups_cloud tags_post_id=0 assigned_class=tag_assigned show_all_groups=1 div_id=second_cloud]


I think you can easily figure out which tags I have used for this post: plugin, Software and WordPress


The styling that I have used for these examples is:

.tag_assigned_1 {color:red !important}
.tag_assigned_0 {color:blue !important}

Show 1 footnote

  1. If you are new to css: The styling still needs to be defined somewhere, referring to the value of assigned_class with an appended _0 or _1. The style of the class with _0 is used for not-assigned tag and likewise _1 for assigned tags.