I was pretty annoyed with the default tag cloud widget. It does a lot of things wrong, like inconsistent HTML markup and hardcoded font sizes. So I wanted to write my own. Digging through the code I found out that the wordpress wp_tag_cloud() function is pretty powerful. In fact, it could do almost everyhing I want. So I abandoned my plan to rewrite everything from scratch and added a nice admin interface to my tag cloud widget.
This plugin makes the options for wp_tag_cloud() available to a tag cloud widget and a shortcode. This means that you can easily choose things like font sizes, HTML markup and ordering. See the wp_tag_cloud page for what the settings can do.
Additionally, it is possible to sort tags by count and alphabetically at the same time. It is also possible to add a counter to the tags, so that your visitors can see how many posts are associated with each tag. The plugin also adds a sensible CSS class to every tag.
Here's a demo of the new shortcode:
Tag cloud
feeds RSS feeds template Typo3 typoscript plugin WordPress CSS HTML YAML theme Webdesign realurl SEO SQL WordPress plugin JavaScript onclick onfocus apache duplicate content lighttpd redirect server git test theme theme preview theme switch theme switcher balloons christmas showstorm snow valentine better tag cloud configurable tag cloud flexible tag cloud improved tag cloud tag cloud fireworks move comments WordPress comments easy mail form simple zero conf mail delete comments delete pending comments custom avatars clicktracking jQuery marketing usability navigation WPMU ajax WordPress theme autotag category custom taxonomy PHP tag pagination options page settings api login custom post type development WordPress page WordPress post file upload paste pastebin recent posts Widget related content related posts query cool uri rewrite api 404 search search form order posts WordPress query meta data WordPress network bash cookies password recursive download wget rant yaml mootools howto border-radius safari virtual hosts audio Linux mp3 mailman title opera advertising geotargeting openx targeting Debian kernel wlan comments desktop openbox xorg mac powerbook accents keymap firefox ext4 gphoto2 photography powershot svn Custom Loop video shortcode WordPress loop security rewrite wp_nav_menu cups printer printing wp_enqueue_style simpleXML XML DOM HTML parser innerHTML fuse sshfs minify wp_register_style spam keywords separator import PageRank Django virtualenv init gunicorn Lenovo install Thinkpad nginx hotlink typo3 extbaseUsage
The easiest way to use this plugin is to drag the widget into one of your sidebars.
There is as well the shortcode [nktagcloud]. Examples:
- [nktagcloud] This displays the tag cloud as configured on the options page.
- [nktagcloud single=yes] This does the same but shows only the tags of the current post.
- [nktagcloud post_id=1234] Displays the tags of the post identified by post_id.
- [nktagcloud separator="" categories=no] Remove separator and categories.
Using the tag cloud in your theme
You can call the function nktagcloud_shortcode() from your theme to get the same output as from the shortcode. Example:
<?php
if ( function_exists( 'nktagcloud_shortcode' ) ) {
echo nktagcloud_shortcode( null );
}
There's also the nk_wp_tag_cloud() function. You can use it to generate a tag cloud with a different configuration than the plugin's one. It accepts the same parameters as wp_tag_cloud(). Example:
<?php
if ( function_exists( 'nk_wp_tag_cloud' ) ) {
echo nk_wp_tag_cloud( 'single=yes&separator= - &categories=no' );
}?>
Additonal parameters (all strings):
- single: Only tags of the current post ('Yes', 'No')
- categories: Inlude categories in the cloud ('Yes', 'No')
- replace: Convert blanks to non-breaking spaces ('Yes', 'No')
- post_id: Display only tags of the specified post (post ID)
- mincount: Show only tags that have been used at least so many times
- separator: Tag separator
- inject_count: Add a counter to the tag ('Yes', 'No')
- inject_count_outside: Add the counter outside of the tag hyperlink ('Yes', 'No')
- nofollow: Add the noffow attribute to the tags in the cloud ('Yes', 'No')
Downloads are at the plugin's WordPress.org page.
Most plugin demos are disabled at the moment. I'll restore them as soon as possible.
I am Nicolas Kuttler, a web developer, system administrator and IT consultant from France, currently living in Germany.




Thanks for this great plugin.
I am having little problem here.
Everything is perfect except the underlines.. how do i remove them? i tried css codes above but didnt work..
Thanks
Good luck !
Is there a way to get one (or some) particular post(s) at the top of the page, once you clicked in the cloud. Like a "sticky" post, only just for the posts on the tagged page (post tagged '.....').
e.g. I always want the 5th post at this page at the top of this page: http://www.carolineaalbers.nl/?tag=zatopek-dragon
Best regards.
Jeffrey
You can get free support on the wordpress forums and IRC channel.
Thank you in advance!
I have just installed your great plugin, but despite putting different font sizes they all appear under the same one which is a bit boring...Really want something like your tag cloud demo with different size. Is there something I should change in my theme? Thanks!
the tags only have different sizes if you use them a different number of times. Same number means same size.
Am I using this incorrectly? Or is this feature broken with the new version?
Thanks!
A problem tough, on my wordpress.org site (theme: Press Portfolio) I have changed in it's php the number of thumbnails displayed on the front page to 24, as you see when you first enter the site or click the logo.
But when I use the Better tag cloud to filter the page down it always return only 10 posts, is there anywhere I can get it to return all the results when clicking the tag?
Thanks a lot!
Rickard
Is it possible with this plugin, or in general, to make the tags given to private posts appear in the cloud also?
Cheers,
~Naomi
I have installed the better tag cloud plugin. And It seems to work. I have a custom post type registered and I want to show via a widget or the placement code a limited amount of tags of only this Post type. the post type for instance is called dialog, I have also added the post_tags parameter to the registered post type and I have a hand full of tags. But nothing shows up.
I tried the placement but nothing shows up. I am now using the widget on a position i made for it, and the title shows and an empty list. I added the costum post name to the taxonomy field in the widget. To no avail.
What can i do ?
Also added a line to inc/page making sure it uses the taxonomy tags, but this to does nothing.
I have installed this and it does what I want which was to allow me to display more tags than the default. However I cannot make it look the way it's supposed to. The options I have are "flat" or "List" and in my sidebar it looks really neat rather than the default look and how yours looks. Mine is a modelling related blog so I can't post a link here, it is working, it just doesn't look like it's supposed to. Hope I've made sense!
I downloaded your plugin today and I am really happy with it. I appreciate this work you have done for the benefit of others.
I have on question: how can you justify the text in the could. The cloud here on your site looks great. How can I achieve this result also?
Your help is greatly appreciated.
Best regards,
Bhakti Kamal Tyagi