Tag cloud sidebar widget for WordPress, because my sidebar wasn’t long enough
Sterling Camden
UPDATE (2009-6-20): For a highly configurable widget that uses the tagging system built into WordPress, use this one.
On the advice of Alec Saunders, I enabled tagging in my blog using the Jerome’s Keywords plugin for WordPress 2.0. Then I went through my posts and got all Chris Pirillo on the tags.
Jerome’s Keywords plugin has a lot of nice features and good documentation. It even provides a great function for generating a tag cloud, where you can render tags differently depending on their use count without much trouble. However, it doesn’t provide a sidebar widget for that, and you can’t just plunk PHP code into a text widget, because it isn’t executed on the server. So, I decided to write a widget that would provide a tag cloud from the keywords. You can download it from Chip’s Tips. You can see it in action in the sidebar on the right, if you are reading this at my site. I found that using a maximum font size of 6 worked best for my theme. Your mileage may vary.
This was my first attempt at writing a sidebar widget for WordPress, and I must say I found it quite easy. Kudos to Matt and team for keeping the interface simple yet powerful, and for providing some good examples. It was so easy, I might get all widget-happy and write some more, until my sidebar gets to be about eighty miles long.
UPDATE: Besides recently adding caching, I also fixed a bug in the font class attribute.� If you downloaded this widget before 6/16/06, you might want to get a fresh copy.
Posted in Blog Blog, Coding...OK?, Wildly popular |
39 Comments » RSS 2.0 | Sphere it!





[...] Tag cloud sidebar widget for WordPress, because my sidebar wasn’t long enough [...]
[...] So far in the short history of this blog, this page has received by far the highest number of page views — about five times that of any other post. Why is that? [...]
[...] Sidebar envy? Chip's is longer than most. He writes: On the advice of Alec Saunders, I enabled tagging in my blog using the Jerome’s Keywords plugin for WordPress 2.0. Then I went through my posts and got all Chris Pirillo on the tags. Tag cloud sidebar widget for WordPress, because my sidebar wasn’t long enough [...]
Great job, so far this has been the best tag cloud widget I could get up and running. One question though, my tags don’t seem to show any ‘weight’, they all display in the same font size.
Any ideas how I can fix this?
trees420, thanks for using the widget and commenting here.
First, the stupid response: In the widget control, make sure that the minimum and maximum font size fields have different values.
Now, the more likely cause: Check the stylesheet for your theme to see if your sidebar is imposing a font size for the whole section. You might be able to modify that to only style the font for the other sections, or else you may have to override the styling for just this section (div#keywords-tagcloud-box) or the individual font elements (font.keywordn, where n is the size specified.
sterling, thanks for the advice.
I tried removing the ‘font-size’ from the style.css and all it seemed to to was make the font huge, but still not weighted.
I’m kind of lost on how to “override the styling for just this section (div#keywords-tagcloud-box) or the individual font elements (font.keywordn, where n is the size specified.”
Which file can i find div#keywords-tagcloud-box and font.keywordn, or is this a section i am going to need to add to my css?
Sorry, but I’m pretty newb when it comes to css…
Oops — I had a bug in the script that I’ve corrected. Please download it again.
Then add lines like the following to your style.css (one for each size):
div#keywords-tagcloud-box font.keyword1 { font-size: 1; }
thanks again, i’ll give this new version a try, but i was finally able to fix it by tweaking my css. i was able to give the tags weight by removing the ‘font-size’ and ‘font-weight’ variables in the #sidebar a and a:hover sections.
this might work as a good work-a-round for someone who doesn’t upgrade.
trees420, glad you got it working. The only trouble with removing the font styling for #sidebar is that you’re probably affecting the font used in other parts of your sidebar. If the overall look is still tolerable to you, then great.
[...] I just downloaded, uploaded, and activated Jerome’s keywords manager, v2, by Johannes Jarolim. This WordPress plugin lets you manage the keywords associated with the Jerome’s keywords plugin, which I use for tagging. The management plugin dovetails nicely with my tag cloud widget, because it lets you rename tags across all posts, among other features, as shown below: [...]
[...] I decided to finally get a tag cloud going on SOB. I don’t really think a tag cloud increases the usability of this site at all, but I’m sure it’ll help with search engine ranking. Because good ol’ Sterling has forged ahead in the world of site tagging, and even gone the extra mile by writing his own tag cloud widget for WordPress, I found that procrastination has again paid off in spades: the hard stuff has already been done for me. [...]
[...] My tag cloud widget for WordPress continues to be popular, closing in on 200 downloads. Today I noticed a Greek blog using it. In terms of small and flat, I think the world is down to a dime now. Hey, Nikos — make sure you get the correction for Jerome’s Keywords, too. [...]
[...] Here’s an innovative use of my tag cloud widget for WordPress. Cale’s front page places the sidebar across the page, containing only the tag cloud. The tags thus become the primary content for the page. Clicking on the links, though, reveals that he’s apparently still constructing the rest of the site. [...]
[...] Hey fellow tag cloud inhabitants! I just posted another correction to the Jerome’s Keywords plugin over on Chip’s Tips. [...]
[...] Jerome Lavigne has a 2.0 beta version of his Jerome’s Keywords plugin for WordPress available. Besides implementing lots of cool new features and fixing some important bugs, Jerome reworked most of the code. As a result, my tag cloud widget no longer worked. So, I created a new version that is 2.0 compatible. Unfortunately, it is not 1.9 compatible, so make sure you get the right one. With my eager permission, Jerome intends to include my widget in the next released version of the plugin, at which time I’ll take down my latest download and point over to his site instead. [...]
Thanks for the tag cloud widget, really helped me get up and running fast.
Glad you like it, Rirath. Are you using Jerome’s Keywords 1.9 or the 2.0 beta?
[...] Tag cloud sidebar widget for WordPress, because my sidebar wasn’t long enough [...]
Great job ! nice plugin, it works for me !
David, glad you like it, but I don’t see it at your site.
Thanks a lot for this tip, i was just looking for something like this !
You’re welcome, Rene. Let me know when you have the widget enabled on your site, and I’ll link to you!
Good job man
Merci, ParKour!
is there a way to display them as a list rather than a cloud? any help is appreciated. thanks!!
Danielle,
If you get the latest version here, then you should be able to style the links in your stylesheet by accessing a.cosmos like so:
a.cosmos {
display: list-item;
}
I’d try it myself, but I’ve moved on to the native tagging in WordPress version 2.3.
[...] Tag cloud sidebar widget for WordPress, because my sidebar wasn’t long enough (5/28/2006) [...]
[...] Tag cloud sidebar widget for WordPress, because my sidebar wasn’t long enough — Chip’s Qui… On the advice of Alec Saunders, I enabled tagging in my blog using the Jerome’s Keywords plugin for WordPress 2.0. Then I went through my posts and got all Chris Pirillo on the tags. (tags: wordpress) [...]
thanx
you’re welcome.
[...] keywords-tagcloud – displays a tag cloud using keywords from the jeromes-keywords plugin [...]
[...] keywords-tagcloud – displays a tag cloud using keywords from the jeromes-keywords plugin [...]
[...] keywords-tagcloud – displays a tag cloud using keywords from the jeromes-keywords plugin [...]
[...] keywords-tagcloud – displays a tag cloud using keywords from the jeromes-keywords plugin [...]
Does your Tag Cloud show ALL tags you create or does it just stop after showing 20-30 as the tag cloud wiget I’m using does nw?
Yes, but unfortunately it doesn’t use the built-in tags of WordPress — it uses the Jerome’s Keywords tagging mechanism instead. I’ve been planning to introduce a new version that uses WordPress tags and allows for better configuration than WordPress’ built-in widget.
I would recommend using this one instead.
[...] keywords-tagcloud – displays a tag cloud using keywords from the jeromes-keywords plugin [...]
[...] keywords-tagcloud – displays a tag cloud using keywords from the jeromes-keywords plugin [...]