How can I put a list of all site tags on a WP sidebar?
January 25, 2009 11:14 AM   Subscribe

How do I get Wordpress to display a list of all tags, in the sidebar?

New site I'm building uses tags in addition to categories. But the tag cloud thing, aside from being kinda ugly, isn't what we want - rather, we want a list of all available tags, in the sidebar, styled like the other list items on the sidebar (i.e. within ul li ).

Tags on WP are new enough that the documentation is pretty arcane, and there does not appear to be a sidebar widget that displays tags (like there is one for categories). Can you help me figure out how to code this? I'm guessing I'll need a query, running inside a text sidebar widget ...
posted by jbickers to Computers & Internet (2 answers total) 2 users marked this as a favorite
 
Yes, I agree, the way the Wordpress community has picked up tags has not been very useful, so far.

On my boeklog, I still use the markup from the now defunct UTW-plugin [Ultimate Tag Warrior]. Because that code cán still be used in combination with WordPress tags using of the UTWRenderThing.php-plugin. In which case the code for showing all tags as a list could be:
<?php UTW_ShowWeightedTagSetAlphabetical("htmllist","",0) ?>

posted by ijsbrand at 12:37 PM on January 25, 2009


Best answer: It doesn't make a whole lot of sense, but the wp_tag_cloud function can be used to generate a standard listing.

Two methods spring to mind:

1. Make the 'smallest' and 'largest' parameters the same, and choose 'list' for your format.

wp_tag_cloud('smallest=12&largest=12&format=list');

2. Return the tags as an array, and use your own custom PHP to display them:

wp_tag_cloud('format=array');

Either way, you're not going to be able to put that in a text widget because text widgets are just displayed, not executed. Instead, you'll want to either hand-code your own widget or use a plugin like this one to give you a widget which executes PHP.
posted by toomuchpete at 12:42 PM on January 25, 2009


« Older "This Wu album is PHAT!"   |   English practice for ESL students in Northern... Newer »
This thread is closed to new comments.