Note: This plugin is provided for free. Particularly if you use it to make money or in a profit-making context, however, I would appreciate if you could make a donation. Thank you!
- 1 Installation
- 2 Instructions
- 3 Troubleshooting
- 3.1 The tag cloud doesn’t show in a text widget, instead I see the shortcode
- 3.2 The list on the posts page is messed up
- 3.3 Other plugins don’t work properly when a page reloads
- 3.4 Other (mostly dynamic) content stopped working properly
- 3.5 The tabbed tag cloud displays as a list
- 3.6 I have multiple tag clouds on the same page – the first is fine, all other display as a list
- 3.7 Styling doesn’t seem to be effective
- 3.8 The tag groups don’t load. I only see the wheel spinning forever
- 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 creates a new submenu in the Settings menu where you find the description of the parameters. In the settings you can also set another taxonomy than posts, change the appearance and other things.
- Depending on the taxonomy, another submenu called “Tag Groups” will appear under the Post section (default) or what other taxonomy you have chosen.
- Before you can organize your tags in groups, you need to create groups on that “Tag Groups” page. You can later always rearrange their order, add new groups or delete them.
- Then you assign your existing tags to one of these groups. You can assign the tags also while you create them.
- In order to see the tabbed tag cloud, you need to use the shortcode or add a piece of PHP code to your template. The first method is the easier and the recommended one. The appearance can be changed through themes (in the tag group settings) or by accessing the elements directly with CSS (again for advanced users).
Tools on the Tags Page
On the Tags (or other terms, depending on your taxonomy) page you have two useful tools:
This tool lets you assign multiple tags to one group, or unassign them all at once.
- Select multiple tags.
- Choose a group. (“Assign to” in the “Bulk Actions” menu should be selected automatically.)
- Click Apply
You can filter the list by a group to show only tags that belong to that group.
Filter on the Posts Page
On the Posts page (“All Posts” menu) you find a filter on top of the list that filters the posts by tag groups. If the filter is active, only posts are displayed that have at least one tag that belongs to the selected tag group.
Restrictions: The filter does not work for multiple taxonomies (because the standard WP query would connect them with the condition “AND”) and not for “category” (because it interferes with the category pull down menu).
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 settings in the backend.
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.
If you select more than one taxonomy then all the terms of the various categories will be mixed into one cloud. You can use the “taxonomy” parameter to restrict the cloud to particular taxonomies.
The tag cloud can be inserted by a shortcode (in a post, page or widget) or directly hard-coded into a theme.
The instructions are now available on a separate page.
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:
if ( function_exists( 'tag_groups_cloud' ) ) echo tag_groups_cloud( array( 'amount' => 10 ) );
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:
if ( function_exists( 'tag_groups_cloud' ) ) print_r( tag_groups_cloud( array( 'orderby' => '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 of PHP code on this page.
Examples of the Tag Groups cloud
Examples are available on a separate page.
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.
Theme developers can make use of the groups through the property $tag->term_group.
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 tag cloud doesn’t show in a text widget, instead I see the shortcode
Try “Enable shortcode in sidebar widgets” in the settings.
The list on the posts page is messed up
Some users have experienced interference with other plugins that caused the list being messed up, showing wrong content etc. If that happens, turn off the filter in the settings at “filter on post admin”.
Other plugins don’t work properly when a page reloads
Other plugins that use sessions may be affected. Possible symptoms are that calendars, lists etc. (also on the front end) cannot switch to the next page, next month or similar. Try to turn off the “filter on tag admin” in the settings.
Other (mostly dynamic) content stopped working properly
Try to turn off “Use jQuery” in the settings. It is possible that another theme or plugin uses their own jQuery2, causing a conflict.
The tabbed tag cloud displays as a list
Check if “Use jQuery” in the settings is turned on.
I have multiple tag clouds on the same page – the first is fine, all other display as a list
Make sure that starting from the second tag cloud you use in each shortcode a different value for the parameter div_id.
Styling doesn’t seem to be effective
Check if the values for div_id, div_class etc. are valid names for ids and classes. Maybe you also need to purge the cache of your WordPress installation. Use the developer tools of your browser to check if your styling gets overridden by other instructions (try “!important” to enforce yours).
The tag groups don’t load. I only see the wheel spinning forever
This usually means that somewhere your blog outputs a warning or alert that interferes with the data transfer to your browser. Try the following:
- Deactivate all other plugins and see if that helps. If yes, re-activate them one by one (and keep checking the tag groups page) to identify the one that causes the message.
- Add to your wp-config.php file the following lines:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
Then reload the tag groups page and afterwards check the content of the debug.log file in the wp-content folder if there is any error message.
(Alternatively, you can also open the developer tools in your browser and check the response from /wp-admin/admin-ajax.php.)