Title: Display current tag
Last modified: September 25, 2021

---

# Display current tag

 *  Resolved [gavy1](https://wordpress.org/support/users/gavy1/)
 * (@gavy1)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/display-current-tag/)
 * Hello,
 * On a page i am using several MLA Tag Cloud shortcode and a MLA Gallery shortcode
   to display pictures :
 * [https://asso.framasoft.org/pic/keZ2kGbe/FoAmCrtI.png](https://asso.framasoft.org/pic/keZ2kGbe/FoAmCrtI.png)
 * I am looking for a way to show which tag is currently displayed. It could be 
   highlighting the tag in the corresponding Tag Cloud or displaying as text : “
   You are viewing the pictures about [tag]”.
 * Is that possible ? If not, any other way ?
 * Thanks for reading me !

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [David Lingren](https://wordpress.org/support/users/dglingren/)
 * (@dglingren)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/display-current-tag/#post-14910784)
 * Thanks for your question and for the link to your screen shot; very helpful.
 * You can adapt either or both of the following suggestions for your application.
   The first suggestion gives a way to highlight the current tag in the cloud. The
   second gives a way to add the tag name to the gallery display.
 * First, the current tag cloud term has a special CSS class assigned to it. The
   default class name is `mla_current_item`, but you can change this by adding a`
   current_item_class` parameter to your `[mla_tag_cloud]` shortcode if needed.
 * You can use CSS styles in your theme stylesheet or inline to highlight the current
   item. Here is a shortcode you can adapt to your page for the cloud:
 *     ```
       <style type='text/css'>
       #mla-tag-cloud .mla_current_item {
       	color:#FF0000;
       	font-weight:bold}
       </style>
       <span id=mla-tag-cloud>
       <strong>Tag Cloud</strong>
       [mla_tag_cloud taxonomy=attachment_tag post_mime_type=image number=20 limit=5 orderby="random" current_item="{+request:current_item+}" mla_link_href="{+page_url+}?current_item={+term_id+}&tax_input{{+query:taxonomy+}}{}={+slug+}" mla_link_class="{+current_item_class+}"]
       </span>
       ```
   
 * The inline styles are used to mark the “current term”, and the span tags around
   the cloud make sure the inline styles take priority over styles defined in your
   theme.
 * Second, to add the current tag name to your gallery display you can adapt the
   solution from this earlier topic:
 * [Warning: array_key_exists()](https://wordpress.org/support/topic/warning-array_key_exists-21/)
 * The first post in that topic illustrates the idea. The `[mla_tag_cloud]` parameters
   add `current_name={+name,url+}` to each link in the cloud. The first `[mla_gallery]`
   shortcode just below the cloud uses `post_mime_type="a-bad-type"` to ensure an
   empty “gallery” and then uses the `mla_nolink_text` parameter to display a header
   with `{+request:current_name+}` to display the current tag.
 * I hope that gets you started on a solution for your application. I am marking
   this topic resolved, but please update it if you have any problems or further
   questions regarding the above suggestions. Thanks for your interest in the plugin.
 *  Thread Starter [gavy1](https://wordpress.org/support/users/gavy1/)
 * (@gavy1)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/display-current-tag/#post-14931868)
 * Hello David,
 * I adapted my code using the subject you linked : works just fine!
 * Thanks a lot !

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Display current tag’ is closed to new replies.

 * ![](https://ps.w.org/media-library-assistant/assets/icon-256x256.png?rev=973502)
 * [Media Library Assistant](https://wordpress.org/plugins/media-library-assistant/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/media-library-assistant/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/media-library-assistant/)
 * [Active Topics](https://wordpress.org/support/plugin/media-library-assistant/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/media-library-assistant/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/media-library-assistant/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [gavy1](https://wordpress.org/support/users/gavy1/)
 * Last activity: [4 years, 7 months ago](https://wordpress.org/support/topic/display-current-tag/#post-14931868)
 * Status: resolved