Oct 312014

I needed to get a list of all the tags used by posts in a specific category, linking them through to the appropriate archive page, and I just couldn’t find anything that would do it for me. So I ended up writing a little shortcode which I could just stick into a text widget and feed with the category I wanted…

Example usage : [categorytags cat=”a-category-slug”/]

It will take either a slug or an id (I find using slugs a lot easier!).

You can stick the code straight into a theme’s functions.php, or you can turn it into a plugin. And it’s easy enough to change the output to produce, say, a list instead of paragraphs.

The one thing this code does not do is any counting, so if you want a tag cloud effect then you’re going to need to enhance it yourself (or find another ready-made plugin).


 Posted by at 12:02 am

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">