Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm looking to show the tags of a post within a widget. I know this is hard because it's outside of the loop, but has it been done, is there one available?

Thanks for any assistance.

Hudson

share|improve this question
add comment

3 Answers 3

Its not very hard actually, wordpress supports multiple loops and query's.

The best way to create a secondary (or more) loop is to make an instance of WP Query, http://codex.wordpress.org/Class_Reference/WP_Query

Using that you can make a simple query that gets the posts tags using wp_get_post_tags http://codex.wordpress.org/Function_Reference/wp_get_post_tags

Then you would throw the code into a widget, http://codex.wordpress.org/Widgets_API.

share|improve this answer
add comment

I believe this plugin does exactly what you're looking for: http://wordpress.org/extend/plugins/nktagcloud/

Hope this helps! Michelle

share|improve this answer
add comment

Tags can be shown outside the Post loop using the global functions.

Step 1 : Get a PHP Code Widget (this solved many problems)

Step 2 : Place the Code <?php the_tags(); ?> in widget and Save.

Check Tags Documentation to tweak display order.

All done just rock and roll.

share|improve this answer
1  
Nice! This worked for me. Tags in Widget. –  Rafee Dec 10 '12 at 12:45
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.