Have you noticed that many blogs have a tag cloud in their sidebars? however, not many have a tag cloud page. Why a tag cloud page you may ask! Well… many reasons: de-cluttering your sidebar, adding interactivity to your blog, … Or maybe you have so many tags that they don’t fit in your regular tag cloud widget.
So that’s what this tutorial is about: creating a tag cloud page.
Before we start
Before we start, you need to be running WordPress version 2.3 or later, and of course have a bunch of posts with tags, otherwise you may end up with an empty tag cloud.
Creating the page template
First, we need to create a custom page template. A page template is nothing more than a PHP file with a special commented code at the beginning of the file.
Go ahead an create a new php file and name it “tagcloud.php” or whatever you want. Now put the following at the beginning of it:
<?php /* Template Name: Tag Cloud */ ?>
With this we’re telling WordPress that our tagcloud.php file is a page template and it’s name is “Tag Cloud”.
The basic structure
Now let’s add the basic page structure, header, sidebar and footer. Of course, this depends on the theme you’re using. I’m just going to assume we’re using the Kubrick theme structure for this tutorial. I recommend you open the page.php file of your theme and try to replicate it. The resulting file might look something like this:
That would print an empty page because we haven’t inserted the template tag yet.
The template tag
Now we need to put in the tag cloud template tag: wp_tag_cloud(), which will print the tag cloud. You can find more information on the wp_tag_cloud() template tag in the codex.
Okay, let’s add the template tag:
Notice that we entered “number=0” parameter, this is because, by default, the wp_tag_cloud() template tag only prints the 45 most used tags, and we want to display them all instead.
Also, we’ve placed the template tag inside a div with a class of “tag_cloud” in case we need to style it later with some CSS.
We’re done with the PHP part, now save your file and upload it to your theme directory (wp-content/themes/your_theme_name).
Creating a new page in WordPress
All we need to do now is create the page in WordPress. To do this, you just have to follow these steps:
- Go to the Write » Page section of the admin panel.
- Type a descriptive title for the page in the Title field.
- Locate the Page Template panel, open it if it’s closed, and choose “Tag Cloud” from the drop-down menu.
- Hit the Publish button.
And we’re done. Feel free to post your thoughts and questions in the Comments section.
Cool idea. I love the tag cloud, but hate the way it hogs space on my sidebar.
First of all… GREAT site! I just found it via Weblog Tools Collection (and I’m definitely going to try your Pistachio theme). I do have my tag archive done the way you explained it, yet, I’ve been cracking my head with something. I just to have a really cool tag archive using and add on for Ultimate Tag Warrior. When UTW became obsolete, the functions were lost.
The add on displayed the tags in a list format, which you can also do with the wp_tag_cloud tag, but I can’t figure out a way to make the columns show as the add on did. Since I saw you modified an Alex King plug in, would it be too much to ask you to take a look at the add on code? I hope you can! (link)
Again, thank you for the site, I found a couple tricks I’m going to try.
@Fer: I have never used the Ultimate Tag Warrior plugin, but, I found this site which offers a version of the plugin that still allows you to use the plugin functions, but with the native WordPress tags. Maybe that’ll work for you.
Oh… and thanks for the compliments 😉
Thanks for the tip, I’ll give it a try!
[…] How to make a tag cloud page | WordPress Guy (tags: wordpresstutorial via:mento.info) […]
thank you! so easy to follow! i just have to figure out how to remove the unsightly link underlines that show up, but hopefully a quick html tag will fix that! i’m also going to try and get some archiving going like this: http://www.srah.net/weblog/archives.php
thanks again!
Thanks!
Beautiful instructions, very easy to follow
E.
nice tips..it’s work in my blog
[…] Theme 2. ขอบคุณ wpguy และ staygolinks […]
[…] the original code for the categories (which I don’t use anymore) – with some help from WordPress Guy’s quick tutorial on the subject. Dropping the code in and just inserting a “50″ […]
great information. before read this article i didnt know about tag but after reading this i know a lot things about tag
thanks for sharng
Well done – I was after this as a plug in and looked for ages. So I have found this instead, I had no idea that I had this many tags. Only down side is – I don’t know how effective this will be for the google bot or SEO purposes.
But great guide and straight forward !!
Although I think that a tag cloud in sidebars is a better way,I appreciate what you created for those who have too many tags.
Hey, Normally I don’t bookmark many sites, and i mean it’s quite rare.. but i’ve been looking forever to find a site that explained how to do this without installing any other plugins and you did it. I appreciate that. Good site you’ve got here, and thank you.
Hello friend
thankyou very much for your instructions,,,so easy to folllow:)
Hi,
Thank you very much for this easy to use guide, I have already implemented it on some of my clients sites.
Great work!
Ronny
many thanks ! GOD bless you. it helped me a lot.
Oh! That was refreshingly easy! Thank you WordPress Guy!
very cool. Worked exactly. Any chance in adding some style tho? Mine looks ugly as is and for some reason extends beyond the posting dimensions. click on my name about to go to the site. Please help.
Worked great! thanks very much
[…] Cloud tag page in WordPress – […]
Thank you! ♥
Great tip thanks! Does anyone know how to show the WP Cumulus content on a page?
Awesome thanks!
Excellent, thanks a lot!
Hey thx for this awsome Idea! But i used Inline PHP, to i dont have to crate an Layout Page for that.
Hi thanks it works, I just created a tag cloud page with help of this article.
Great!
You can see it in action on http://personalshoplifter.com/tags ….especially great as it picks up the CSS of the site design!
hi. thanks for the great directions. I have it working on my site, but I can’t seem to style the type the way I want. My CSS is iffy at best and I wonder if you could illuminate this sentence for me:
“Also, we’ve placed the template tag inside a div with a class of “tag_cloud” in case we need to style it later with some CSS.”
I just meant that I added class=”tag_cloud” to the div that contains the tag cloud. Later you can use the .tag_cloud selector in CSS… does that make sense?
making a tag cloud was easier than i thought. thanks for the help.
Didn’t show all the code. Trying again
<div >
‘‘.__(‘Pages’,’gpp_i18n’).’: ‘, ‘after’ => ”, ‘next_or_number’ => ‘number’)); ?>
<?php edit_post_link(__(‘Edit this entry’,’gpp_i18n’), ”, ‘.’); ?>
Shit, sorry. Why can’t I paste all the code? Any hints on where to put the template tag in? I’ve tried just a few places, and can’t get it to work right.
Thanks again
Oh god, thank you so much (well alright maybe you aren’t god) I have been trying to figure this tag BS out. Scrabble Board Game site
Hi, thanks for the tips. Just one question, I’m having more than 100 tags on my tags cloud page. I want every tags to be included, but paginated at 100 tags per page. Is there any solution for this? Thanks.
Thanks for the tutorial!
I’m trying to use the topic_count_text_callback=default_topic_count_text argument, but I’m not getting what I had hoped. I had hoped to see the count per tag in parentheses following the tag, but instead the callback function puts the count in the TITLE attribute.
Is there an argument value for topic_count_text_callback that would allow me to present the tag count?
Thanks!
good idea for tag clouds including code i like it i will try it thanks for sharing
[…] 참고: How to make a tag cloud page […]
my template starts with
where should i put
Good article just not sure about value of tag cloud? Mobile Park Home Retirement
Great guide! Took just a couple of minutes and worked perfectly on WordPress 3.2.1. Page can be viewed here: http://www.ancarb.co.uk/tag-cloud/
Thanks v.much!
nice one , it worked
If you wish for to increase your experience only keep visiting this web page and
be updated with the hottest news update posted here.
Its like you read my mind! You seem to know a lot about this, like you wrote the book in it or something.
I think that you could do with a few pics to drive the message home a bit, but other than
that, this is fantastic blog. An excellent read. I’ll definitely
be back.
Hello colleagues, how is all, and what you wish for to say regarding this paragraph, in my view its really remarkable
in favor of me.
Admiring the hard work you put into your blog and
detailed information you offer. It’s nice to come across
a blog every once in a while that isn’t the same unwanted rehashed material.
Wonderful read! I’ve saved your site and I’m adding your RSS
feeds to my Google account.
Its very use full code to make cloud tag and much more than this..Great tips
Thanks
Thank you for the great tip. You provided the basic thought and I added some more code and it worked great!
I added more code because when put like that, the theme’s sidebar got all messed-up. I had to define it like the rest of the page templates in my theme and it’s awesome!
Thank you!
Nice, was searching for this 🙂
Hi,
Thanks for the post, Its working fine, but if we are having more then 10000 tags then its not a good idea to show all the tags on a single page, so I just want to know that is it possible to create pagination for tag page so that we can show all of our tags.
Thanks
Waiting for reply.
Comments are closed.