The Taxonomy Widget Plugin enables users to create widgets in their sidebar that display all terms of any given taxonomy. Users can choose between 3 different templates including two types of lists, a term cloud or a dropdown menu.
Options
Title – You can enter a custom title for your widget in this text input. If you leave this field blank, The name of the taxonomy will be used. If you do not want a title displayed at all, you can toggle this by un-checking the Display title box under Advanced Options.
Taxonomy – You can select the taxonomy whose terms you would like displayed by selecting it from the dropdown menu.
Template – Select a template for your terms by selecting one of the radio buttons in the Display Taxonomy As section.
Display title – If checked the title will be displayed. Un-checking this option will hide the title. Defaults to checked.
Show post counts – If checked, the number of posts associated with each term will be displayed to the right of the term name in the template. This option has no effect in the cloud template.
Show hierarchy – If checked, the terms will be indented from the left if they are children of other terms. This option has no effect in the cloud template.
Download
Latest version: Download Taxonomy Widget Plugin v0.6.1 [zip]
Installation
- Download
- Unzip the package and upload to your /wp-content/plugins/ directory.
- Log into WordPress and navigate to the “Plugins” panel.
- Activate the plugin.
Changelog
0.6.1
- Set value of the “taxonomies” property a bit later in the action sequence.
0.6
- Cleanup.
- Provide alternative default if categories are disabled.
- Do not register widget if no taxonomies are registered.
0.5.1
- stupid comma …
- another stupid comma !!!
0.5
- Better escaping throughout.
- Use get_term_link() for javascript redircts.
0.4
- Never officially released.
- Dropped support for 2.9 branch.
- Removed mfields_walk_taxonomy_dropdown_tree().
- Removed mfields_dropdown_taxonomy_terms().
- Removed global variables.
- Moved javascript listeners into mfields_taxonomy_widget class.
- Create mfields_taxonomy_widget::clean_args() to sanitize user input.
- Removed mfields_taxonomy_widget::sanitize_template().
- Removed mfields_taxonomy_widget::sanitize_taxonomy().
- Tag clouds will now only display if their setting allow.
- Tested with post formats.
- Removed mfields_taxonomy_widget::get_query_var_name() using $taxonomy->query_var instead.
0.3
- Added filters for show_option_none text in dropdown.
0.2.2
- Don’t remember. Sorry…
0.2.1
- BUGFIX: Dropdown now displays ‘Please Choose’ on non-taxonomy views.
0.2
- Now compatible with WordPress Version 2.9.2.
0.1
- Original Release – Works With: wp 3.0 Beta 2.



OK, here’s a tough one that I can’t figure out.
I am using the tax widget and it functions exactly as it should. However I am still working out my function for the taxonomy template display. Have posted a few places but no response yet. Maybe you have run into this before.
Scenario:
I have a custom taxonomy registered to multiple post types. When I go to a page that shows the taxonomy, I am trying to write a function that will sort the results depending upon the post type.
example link:
http://deardaddy.org/series/unidos-messages/
What that is ‘supposed’ to be doing, is separating out the results and placing the results from post type ‘sermons’ first, and then display the ‘podcasts’ second. I am rolling with 2 separate loops to do this.
'sermons','taxonomy'=>'series','term'=>$term->slug);$query = new WP_Query ($wpq);
while ( have_posts()) : the_post(); ?>
//do stuff
The problem is my first argument post_type ‘sermons’ is being ignored. I have tried every variation I can think of but none work.
Do you have any ideas or see something wrong with the code example above?
–once fixed I do plan on extending the function to allow paging, possibly via ajax, per post_type. Still working that concept out in my head.
Shawn,
Hmmm, your code looks alright to me, but I have little experience thus far with use of custom post types. Did you try to reset the query before you ran the first custom loop? This might help. I’m going to play around with this for a few minutes and see if I can find an easy solution. This is a pretty neat idea that others would find useful as well.
BTW, in the future, if you want to post code wrap the code in php shortcodes – [ php ] [/ php ] – and it should render nicely
Yes, I reset the query prior to use, sorry, should have included that in example code.
You are correct, with post types, these are the type of questions that are going to be coming up over and over again. That is the hard part for me, being that I am so far ahead of the game with 3.0 being beta and all. There are very few of us actually ‘pushing the boundaries’ of post types right now, which makes support resources hard to come by. To date, even though my sandbox site looks basic, I believe that it’s one of the most advanced examples out there right now. Especially when you consider that I am using multi-relational post types. Meaning when I add a ‘sermon’ I can select to relate it to podcasts, so data is only entered once per instance. (props to Scribu on that one)
thanks for info on php, didn’t see it in your list below, so didn’t think to try it. duhhh lol
Here’s my solution which worked on 3.0 BETA (which ever build I downloaded last week). Repeat this block for each post type you would like to display:
$my_query = get_posts( array( 'numberposts' => -1, 'post_type' => 'page', 'taxonomy' => $term->taxonomy, 'term' => $term->slug ) ); if( $my_query ) { print '<h2>Pages</h2>'; foreach( $my_query as $post ) { setup_postdata( $post ); the_title( '', ' - <b>' . $post->post_type . '</b><br />' ); } }OK, I know that this is going to sound really amateurish, but I’m a bit stuck converting your script with mine.
Basically I use the normal have posts followed by ‘normal’ theme styled output like:
< php $wpq = array (post_type =>'sermons','taxonomy'=>'series','term'=>$term->slug); $query = new WP_Query ($wpq); while ( have_posts()) : the_post(); ?> < php do_action( 'bp_before_blog_post' ) ?> <div class="post" id="post-<?php the_ID(); ?>" <div class="post" id="post-<?php the_ID(); ?>"> <div class="author-box-video-archive"> < php $video = shawn_embed('width=200&height=150'); ?> <?php if (!empty($video)){ ?> <div class="video <?php echo $GLOBALS['single_align']; ?>"> <?php echo $video; ?> </div><!-- /.image --> <?php } ?> </div> //etc etc etc.... < php endwhile; wp_reset_query(); >I somewhat see how your function above is doing what it is doing, but I can’t seem to figure out how to insert it into your query properly. I should note that I have no php background, learning on the fly, but trying very hard.
I did try your example and it did work exactly as expected. So we know the function works even on last nights build.
You just have to stick your code in the middle somehow:
if( $my_query ) { print '<h2>Posts</h2>'; foreach( $my_query as $post ) { ?> //Stick your code in here - the "Loop" code <?php } }:) It worked perfectly.
http://deardaddy.org/series/the-anointing/
I can actually see a lot of people needing this in the future, should add it to your code snippets section.
What is going to be really cool is when I figure out the ajax, so you see 5, but ‘click more’ and 5 more show up etc.. kind of like how the bp activity stream does it. That’s about the only way I see to paginate multiple content types in a way that makes sense to people
Awesome! Glad it worked for you. Definitely going to add this to the snippets section. And your jQuery idea for pagination sounds cool, if you get it up and running, please let us know how you did it!
Just so you don’t also end up banging your head into the same wall. It turns out that it was not working, and now I know why. Wp does not support sort via custom post_type + taxonomy term yet.
http://core.trac.wordpress.org/ticket/13582
For awhile there, I thought I was really loosing my mind. I never would have guessed that it wasn’t available natively in wp. At least now we know. The good news, if there is any, is at least this will be such a fundamental requirement, that I expect a patch rather soon.
I just noticed this tonight that the widget will show a taxonomy for a post that hasn’t been posted yet. I scheduled a story for a new author, and sure enough it’s in my sidebar. :(
Maybe something you can fix for the next release.