Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Brandon Brigham
Brandon Brigham
3,716 Points

Anybody know how to create a category cloud in wordpress? Or know of a plugin?

I'm trying to show a category cloud on my blog page (similar to a tag cloud but for categories)

Is there a way to do this manually? Or does anyone know of a plugin that is current and that works?

Thanks!

2 Answers

Sue Dough
Sue Dough
35,800 Points

The other poster was close. You can pass in some arguments to wp_tag_cloud to make it work for categories. This is what you are looking for.

<?php wp_tag_cloud( array( 'taxonomy' => 'category' ) ); ?>

Source: https://codex.wordpress.org/Function_Reference/wp_tag_cloud#Display_a_Category_Cloud

Hi Brandon,

You may find this page of the codex codex useful. wp_tag_cloud, if you need help implementing this let me know :)

Craig

Brandon Brigham
Brandon Brigham
3,716 Points

Hi Craig -

Thanks for info - I'm looking for something with categories though and not tags - Not sure if this is even possible....

Hi Brandon,

That page of the docs explains that the cloud can be used to show categories. As Sue Dough has shown, you simply update the taxonomy value in the array.

Craig