Search
  • Sotware by
  • Christoph Amthor
Search Menu

Tag Groups Shortcodes

Return to the plugin’s main page.

Shortcode for Tabs

[tag_groups_cloud]

Parameters

Tags or Terms:

  • smallest=x Font-size in pt of the smallest tags. Default: 12
  • largest=x Font-size in pt of the largest tags. Default: 22
  • orderby=abc Which field to use for sorting, e.g. count. Use “natural” for natural sort order. Default: name
  • order=ASC or =DESC Whether to sort the tags in ascending or descending order. Default: ASC
  • amount=x Maximum amount of tags in one cloud (per group). Default: 0 (unlimited)
  • hide_empty=1 or =0 Whether to hide or show tags that are not assigned to any post. Default: 1 (hide empty)
  • tags_post_id=x Display only tags that are assigned to the post (or page) with the ID x. If set to 0, it will try to retrieve the current post ID. Default: -1 (all tags displayed)
  • assigned_class=”something” A modification of the tags_post_id parameter: Rather than hiding tags that are not assigned to the post (or page), they can be styled differently. Tags will receive this class name with appended _1 or _0. (If you output the tags as an array, a new element with the key “assigned” will be true or false.)
  • separator=”•” A separator between the tags. Default: empty
  • separator_size=12 The size of the separator. Default: 12
  • adjust_separator_size=1 or =0 Whether to adjust the separator’s size to the size of the following tag. Default: 0
  • prepend=”#” Prepend to each tag label. Default: empty
  • append=”something” Append to each tag label. Default: empty
  • taxonomy=”x,y,…” Restrict the tags only to these taxonomies. Default: empty (= no restriction)
  • link_target=”_blank” Set the “target” attribute for the links of the tags. Possible values: _blank, _self, _parent, _top, or the name of a frame. Default: empty (= opens in the same window, same as using _self)
  • show_tag_count=1 or =0 Whether to show the number of posts as tooltip (behind the tag description) when hovering the mouse over the tag. Default: 1 (show)
  • custom_title=”abc” Custom title shown as tooltip. No HTML, but you can use {count} and {description} as placeholders. Default: empty (using the description, see also show_tag_count)

Groups and Tabs:

  • include=”x,y,…” IDs of tag groups (left column in list of groups) that will be considered in the tag cloud. Empty or not used means that all tag groups will be used. Default: empty
  • groups_post_id=x Display only groups of which at least one assigned tag is also assigned to the post (or page) with the ID x. If set to 0, it will try to retrieve the current post ID. Default: -1 (all groups displayed). Matching groups will be added to the list specified by the parameter include.
  • show_tabs=1 or =0 Whether to show the tabs. Default: 1
  • hide_empty_tabs=1 or =0 Whether to hide tabs without tags. Default: 0 (Not implemented for PHP function with second parameter set to ‘true’. Not effective with groups_post_id.)
  • show_all_groups=1 or =0 Whether to force showing all groups. Useful with the parameters tags_post_id and assigned_class. Default: 0
  • show_not_assigned=1 or =0 Whether to show a group with not-assigned tags. Default: 0
  • not_assigned_name=”abc” The name used in the tab of not-assigned tags. Default: “not assigned”
  • collapsible=1 or =0 Whether tabs are collapsible (toggle open/close). Default: general settings in the back end
  • mouseover=1 or =0 Whether tabs can be selected by hovering over with the mouse pointer (without clicking). Default: general settings in the back end
  • active=1 or =0 Whether tabs are initially expanded or collapsed. Useful in connection with the parameter collapsible. Default: 1

Advanced Styling:

  • div_id=abc Define an id for the enclosing <div>. You need this parameter particularly if you display more than one tag cloud on the same page, in which case each shortcode needs a different value. Default: tag-groups-cloud-tabs
  • div_class=abc Define a class for the enclosing <div>. Default: tag-groups-cloud-tabs
  • ul_class=abc Define a class for the <ul> that generates the tabs with the group labels. Default: empty

 

Shortcode for an Accordion

The code to create an accordion for the tags is

[tag_groups_accordion]

Parameters

Tags or Terms:

  • smallest=x Font-size in pt of the smallest tags. Default: 12
  • largest=x Font-size in pt of the largest tags. Default: 22
  • orderby=abc Which field to use for sorting, e.g. count.Use “natural” for natural sort order. Default: name
  • order=ASC or =DESC Whether to sort the tags in ascending or descending order. Default: ASC
  • amount=x Maximum amount of tags in one cloud (per group). Default: 0 (unlimited)
  • hide_empty=1 or =0 Whether to hide or show also tags that are not assigned to any post. Default: 1 (hide empty)
  • tags_post_id=x Display only tags that are assigned to the post (or page) with the ID x. If set to 0, it will try to retrieve the current post ID. Default: -1 (all tags displayed)
  • assigned_class=”something” A modification of the tags_post_id parameter: Rather than hiding tags that are not assigned to the post (or page), they can be styled differently. Tags will receive this class name with appended _1 or _0. (If you output the tags as an array, a new element with the key “assigned” will be true or false.)
  • separator=”•” A separator between the tags. Default: empty
  • separator_size=12 The size of the separator. Default: 12
  • adjust_separator_size=1 or =0 Whether to adjust the separator’s size to the size of the following tag. Default: 0
  • prepend=”#” Prepend to each tag label. Default: empty
  • append=”something” Append to each tag label. Default: empty
  • taxonomy=”x,y,…” Restrict the tags only to these taxonomies. Default: empty (= no restriction)
  • link_target=”_blank” Set the “target” attribute for the links of the tags. Possible values: _blank, _self, _parent, _top, or the name of a frame. Default: empty (= opens in the same window, same as using _self)
  • show_tag_count=1 or =0 Whether to show the number of posts as tooltip (behind the tag description) when hovering the mouse over the tag. Default: 1 (show)
  • custom_title=”abc” Custom title shown as tooltip. No HTML, but you can use {count} and {description} as placeholders. Default: empty (using the description, see also show_tag_count)

Groups and Accordions:

  • include=”x,y,…” IDs of tag groups (left column in list of groups) that will be considered in the tag cloud. Empty or not used means that all tag groups will be used. Default: empty
  • groups_post_id=x Display only groups of which at least one assigned tag is also assigned to the post (or page) with the ID x. If set to 0, it will try to retrieve the current post ID. Default: -1 (all groups displayed). Matching groups will be added to the list specified by the parameter include.
  • show_accordion=1 or =0 Whether to show the accordion. Default: 1
  • hide_empty_content=1 or =0 Whether to hide content without tags. Default: 0 Not effective with groups_post_id.)
  • show_all_groups=1 or =0 Whether to force showing all groups. Useful with the parameters tags_post_id and assigned_class. Default: 0
  • show_not_assigned=1 or =0 Whether to show a group with not-assigned tags. Default: 0
  • not_assigned_name=”abc” The name used in the tab of not-assigned tags. Default: “not assigned”
  • collapsible=1 or =0 Whether accordion content is collapsible (toggle open/close). Default: general settings in the back end
  • mouseover=1 or =0 Whether accordion headers can be selected by hovering over with the mouse pointer (without clicking). Default: general settings in the back end
  • active=1 or =0 Whether the accordion is initially expanded or collapsed. Useful in connection with the parameter collapsible. Default: 1

Advanced Styling:

  • div_id=abc Define an id for the enclosing <div>. You need to define different values if you use more than one accordion on one page. Make sure this id has not yet been used – including the active theme and other plugins. Recommended are non-standard values to avoid collisions of names, replace spaces by underscores or hyphens, or use “camelCase”. Default: tag-groups-cloud-accordion
  • div_class=abc Define a class for the enclosing <div>. Default: tag-groups-cloud-accordion
  • header_class=abc Define a class for the <h3> that contains the headers. Default: empty
  • inner_div_class=abc Define a class for the <div> that contains the tags. Default: empty

Multiple Tag Clouds

If you want to use more than one tag cloud, then the div_id parameter needs to be set, starting from the second shortcode, and each values must be different. You can use div_class to have a shared styling for a particular set of tag clouds.

Hard Coding Into Your Theme

You can use the function tag_groups_cloud with the same parameters above for the tabbed cloud. The parameters are provided as array.

Examples of the Tag Groups Cloud

Please see the Demo Pages.

Need more?

Check out the shortcodes of the premium plugin.

Share