Possible applications are:
- Display your tags grouped by language or by topic.
- Display your tags in any order, independently from their names or slugs.
- Choose which tags to display in different sections of your blog.
Please proceed to the WordPress plugin repository.
- Find the plugin in the list at the backend and click to install it. Or, upload the ZIP file through the admin backend. Or, upload the unzipped
tag-groupsfolder to the
- Activate the plugin through the ‘Plugins’ menu in WordPress.
The plugin will create a new submenu in the Post section where you find the tag groups and related settings. After you have created some groups, you can edit your tags and assign them to one of these groups.
Theme developers can make use of the groups through the property $tag->term_group.
If you don’t want to mess around with the code, you can simply embed a tag cloud into a post, page or widget by using the shortcode below. The design of the tag cloud can be customized from the Tag Groups submenu in the backend. If you want to use two tag clouds with different designs on the same blog, you can define the class of each tag cloud through the parameters.
Tag clouds are by default tabbed (each group having its own tab) but you can also have a “normal” tag cloud for only one group.
Since Version 0.4 you can configure the tab cloud to activate the tabs on hovering the mouse pointer over them (instead of clicking) and to toggle the collapsing of the tabs.
Since Version 0.7 you can create a “category cloud” by changing the taxonomy to category.
The tag cloud can be inserted by a shortcode (in a post, page or widget) or directly hard-coded into a theme:
- 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: count, name or empty (means term_id). 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 each group. Default: 40
- hide_empty=1 or =0 Whether to show also tags that are not assigned to any post. Default: 1
- include=x,y,z IDs of tag groups to be used in tag cloud (comma-separated list). Empty means all. Default: show all
- div_id=abc Define an id for the enclosing
. Default: tab-groups-cloud
- div_class=abc Define a class for the enclosing
. Default: tab-groups-cloud
- ul_class=abc Define an class for the
- that generates the tabs with the group labels. Default: empty
- show_tabs=1 or =0 Whether to show the tabs, which contain the group labels. Default: 1 (You can set it to 0 if you display only tags of one group.)
- separator=”•” A separator between the tags. HTML can be used. 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. Invalidates the setting for separator_size. Default: 0
By default the function tag_groups_cloud returns the html for a tabbed tag cloud. If you want to add the tag cloud directly into your theme, you could do it like this:
'1,2,5,6' ) ); ?>
The array can, of course, contain also more parameters:
array( 'include' => '1,2,5,6', 'amount' => 10 )
If the optional second parameter is set to ‘true’, the function will return a multidimensional array containing tag groups and tags:
'count', 'order' => 'DESC' ) , true ) ); ?>
post_in_tag_group( $post_id, $tag_group_id )
Checks whether the post with the given
$post_id has at least one tag that is part of the tag group with the given
$tag_group_id. Returns true or false.
You can find more examples on this page.
Example of the Tag Groups cloud
This tag cloud uses jQuery UI’s theme “blitzer” with “mouseover” enabled. Tags are sorted by ‘count’ in descending order.
Creating Your Own Theme
The tag cloud comes bundled with three themes 1. Alternatively, you can also use your own theme. The easiest way to achieve this is to create one using the jQuery UI ThemeRoller, then download the file, extract from it the part containing CSS and images, upload the contained css folder to your WordPress wp-content/upload folder and then tell Tag Groups where to find it.
Here it is step by step:
- Go to jQuery UI ThemeRoller. On their page you find on the left side “Roll your own”; or pick one ready-made theme from the “Gallery.” In the center part of the page you can see a preview.
- Under the thumbnails in the Gallery or below the “Roll your own” tab you find the download button, taking you to another page (“Download Builder”) with several further options. You will need to select the components “Core”, “Widget” and “Tabs”. The latest version should work with your WordPress installation, or try another one. . Go to the settings at the bottom and enter as “CSS Scope” the class .tab-groups-cloud (including the leading dot) and as “Theme Folder Name” something that will make a good folder name – for example “my-theme” or “red-and-blue”, or just the name from theme gallery.
- Go ahead and download the zipped file. After you unpacked it, open the resulting folder (“jquery-ui- …) and the “css” folder inside it. Inside the “css” folder you find a folder with the previously chosen “Theme Folder Name”.
- Copy this folder with all its contents to your /wp-content/uploads folder of your WordPress installation (e.g. with a FTP client). This place should be save from being overwritten by future updates of WordPress or plugins.
- Enter the chosen “Theme Folder Name” in the field on the Tab Groups Settings page on the backend, select “own theme” and save the changes. If you want to keep your uploads folder organized, you can also create a containing folder for your css and add it to the “Theme Folder Name (e.g. “tag-cloud-themes/blue-theme”).
You can also leave the field for your custom theme empty. You may want to do this for example if the theme of your blog already provides tabs and you like to blend the tag cloud into this design.
Multilingual Support with WPML
Since version 0.3, Tag Groups is ready to be used on multilingual blogs with WPML installed. WPML ensures that tags will automatically show their correct language version depending on the selected language. Tags can be translated directly where you enter and edit them.
All left to do is to translate the tag group labels. To enable this, you need to make sure that they appear in WPML’s string translation module where you can easily translate them. Tag Groups automatically registers new tag groups that you create with WPML installed. Alternatively, you can register your existing groups after installing WPML through the button on the Tag Groups page.
Once you have entered the translations for the tag group labels on the WPML string translation, they will be displayed in the tag cloud on the frontend for each corresponding language.
If you want to have a different design for different languages, you simply change the parameters in the shortcode that you use on the posts or pages of each language.
The changelog is maintained on the WP plugin page.
Questions, Comments and Requests
Please submit them only on the WP discussion forum.
- Quick editing (i.e. inline editing in the table) of terms doesn’t display the current tag group when using Opera (version 12, maybe others too) while saving still works.
… with no clear time frame.
- bulk changes to tags
- option to delete all data generated by the plugin when deactivating it
- hiding tabs that contain no tags
The license of this plugin is GPLv2 or later.
Yes, this plugin is free but it takes much effort to maintain it.
- What I call “Gray” is actually”Smoothness” in the jQuery UI gallery – for historical reasons. ↩