Screenshot of the New Taxonomy Widget Plugin

Posted on

By Michael Fields

A new taxonomy plug-in is on the way! Just waiting for approval from wordpress.org for hosting and then it will be unleashed to the masses. I created this plug-in to give WordPress users an easy way to add a list of custom taxonomies to their sidebars.

Here’s a screenshot of the plug-in:

Screenshot of the Taxonomy Widget

The plug-in enables you to display any taxonomy that can be associated with a post (including tags and categories) in any one of 4 different templates: Ordered List, Unordered List, Drop-down Menu and Term Cloud. As with all widgets, you can use multiple instances.

If you have no idea what a taxonomies are and how you can utilize them to their full potential on your own WordPress powered website, please read the following article the I put together on the subject called New and Exciting Ways to Organize Your WordPress Powered Website

18 Comments Comments are closed

  1. Mac_Boy May 6, 2010 at 1:07 am

    Awesome! I can use this, thanks for all the various options.

    Now I gotta figure out how to show the widget in the main area, not in the sidebar.

  2. Michael Fields May 6, 2010 at 1:16 am

    No problem:) should be available in a few days. In the meantime, something like this should work in your theme:

    $terms = get_the_terms( $post->ID, 'my-custom-taxonomy-slug' );
    if ( $terms ) {
    	foreach( $terms as $t ) {
    		$url = get_term_link( $t->name, $t->taxonomy );
    		if( !empty( $img ) )
    			print '<a title="' . $t->name . '" href="' . $url . '">' . $t->name . '</a>';
    	}
    }
  3. shawn May 9, 2010 at 5:49 am

    by any chance does this plugin display taxonomies applied to a specific post_type?

    Using Justin’s movie db example, I was thinking it would be nice to have a simple widget to show the ‘actors’ taxonomies that are associated with the ‘movie’ page being displayed. –pretty easy to do this already via template but a widget would be nice.

  4. Michael Fields May 9, 2010 at 7:34 am

    Hi Shawn, Thanks for writing and great question as I have yet to actually test this feature. I just gave it a test spin on WordPress Beta2 running TwentyTen and all systems are go! I released the plugin earlier today. You can download it here.. Please let me know how it works for you and if you have any suggestions.

  5. shawn May 15, 2010 at 4:27 am

    Are there any plans on incorporating the taxonomy images into the widget for a given custom-post type tax?

    btw, just found your images plugin today. Wow, love it, small donation already sent.

  6. Michael Fields May 16, 2010 at 10:56 am

    Shawn, Thanks for the donation! Much appreciated :) Could you expand on how you would use the Widget?At this point, I think I will keep all of the taxonomy plugins separate, but I do want to add a heap of functionality to the Taxonomy Images Plugin. There’s a lot of cool stuff that can be done there.

  7. shawn May 18, 2010 at 7:32 pm

    sorry to not have gotten back to answer sooner. Have really been playing with custom post_types and taxonomies for the past few days. Really loving these new tools provided.

    What I was thinking is pretty simple. I plan on displaying the related ‘actors’ in the sidebar when viewing a movie single view page. Currently the tax widget plugin would only show the permalink. It would look nice to display an image of the actor with the permallink next to the image. (I should have an example link of what I am talking about done shortly as that project should be finished today or tomorrow)

    –I’m assuming the widget is capable of filtering the taxonomies being displayed as only those related to the post being shown. I have not yet tested it out to see if it does this or simply lists all taxonomy fields.

    Either way, I am more than capable of simply displaying the tax image and permalink by simply hardcoding it into my templates.

  8. Michael Fields May 18, 2010 at 7:42 pm

    No problem, What you are explaining is out of the scope for the Taxonomy Widget Plugin – but I think that it’s a great addition to the Taxonomy Images plugin. I don’t know when I’ll be able to get to this, I have some client work coming in and that take priority :) But I can assure you that the the next plugin I update will be the Taxonomy Image one and I will include something similar to what you described as I think it is a great addition that will benefit many different types of websites. Thanks for your input!!!

  9. Angelia June 15, 2010 at 8:30 pm

    Hello Michael
    I’ve been pulling my hair out with an issue lately and came across your plugin, which is oh so close to perfection, minus one important issue.

    The issue at hand is to list ONLY those hierarchical taxonomy terms associated with the current post AND list them in their proper hierarchical structure. As you know, using wp_list_categories doesn’t allow for a post-id to be passed into the argument, and get_the_terms_list doesn’t respect the hierarchical structure. If you’re widget could be used on the single post sidebar and only list the terms associated with that post … well … it would be so darn groovy.

    Should you think this a worthy idea, have time for it, be interested, and want to use the site I’m currently developing to test, please let me know as their are custom hierarchical taxonomy terms up to 4 levels deep, associated with custom post types already implemented there. Just drop me an email~

  10. Angelia June 16, 2010 at 2:16 am

    Anyone who finds themselves in the same head banging dilemma I was in of how to actually show the hierarchical structure of your custom hierarchical taxonomy terms as they relate to a single post, Scribu has come to the rescue with a great explanation of how to accomplish this. Check it out here: http://scribu.net/wordpress/extending-the-category-walker.html#comment-3776

  11. Mark June 28, 2010 at 12:33 am

    I found your plugin yesterday. Thank God! I was going crazy looking for a widget like this.

    It’s really useful, but I have a question. Why, instead of showing the “Please Choose,” does it shows the last term in the taxonomy?

    You can see this happening on my VirtualProfessors.com site. The Lecturer and Location areas in the sidebar use it.

    This is the first time I’ve seen you site. Looks really interesting. I’m subscribing to it.

  12. Michael Fields June 28, 2010 at 10:26 am

    Mark, Thanks for your comments and observation. I will look into this issue soon and release an update to the plugin.
    Best wishes,
    -Mike

  13. Federico Vezzoli October 4, 2010 at 11:38 am

    hey Michael, I’m using some piece of your code to displaying a dropdown of a specified taxonomy. I recon I’ve to pass some parameters to mfields_dropdown_taxonomy_terms() but I’m struggling a bit with it.
    Could you help me?
    I have a custom taxonomies associated to a custom post type, will it be a problem?
    thanks a lot.

  14. Michael Fields October 9, 2010 at 7:55 pm

    Why not use the shortcode? All arguments can be found here.

  15. Federico October 11, 2010 at 9:12 am

    I can’t use the short code since I need it for a custom form.

  16. Steven Schofield-Linnell October 12, 2010 at 7:10 pm

    Michael, I have implemented your plug-in but I have found that DRAFT posts are included in the list. They show up either in the post count or where a category is included which has no posts attached to it. Is this something which you could easily address? Thank you.

  17. Michael Fields October 12, 2010 at 8:25 pm

    Steven, this has been reported in the past and I’ll look into it soon. I’m not sure if the WordPress API supports the “hiding” of terms associated to drafts out-of-the-box, but I’ll take another look at core and see if I am missing something.

  18. Josh H. December 15, 2010 at 6:56 am

    Hi Angelia,

    Did you ever turn this into a widget per chance?

Fork me on GitHub