[Plugin: Taxonomy Drill-Down] Can QMT Widget exclude terms outside current taxonomy?
-
Apologies if I’m double-posting but I couldn’t find the answer although it seems my need might be common. I hope I’m asking the correct question (and furthermore that it makes sense).
I’ve got several custom taxonomies that I’m using to describe a custom post type and I’m using taxonomy.php to display the posts that fall under a certain term. I’m using the QMT drilldown widget, but I’d like it to only show terms relevant to the posts that exist within that term.
Here’s the page I’m working on: http://pittsculture.studiotwo.com/directory_categories/arts-and-culture/
My master taxonomy is directory_categories and the term is arts-and-culture, so my page contains only arts-and-culture posts. However, you’ll see the drilldown widget is showing ALL terms from all taxonomies.
My question: Is there a way to exclude terms that are not represented by the current taxonomy?
I see the function below in widget.php. The current query is stored in $query as
array('directory_categories'=>'arts-and-culture')
. I’m thinking this could be passed into qmt_walk_terms() but couldn’t figure out what to do with it without hacking the plugin to bits. I’m hoping there’s an easy answer.private function generate_lists( $taxonomies ) { $query = qmt_get_query(); $out = ''; foreach ( $taxonomies as $taxonomy ) { $list = qmt_walk_terms( $taxonomy, $this->get_terms( $taxonomy ) ); if ( empty( $list ) ) continue; $title = get_taxonomy( $taxonomy )->label; if ( isset( $query[$taxonomy] ) ) { $title .= ' ' . html( 'a', array( 'href' => QMT_URL::for_tax( $taxonomy, '' ), 'title' => __( 'Remove selected terms in group', 'query-multiple-taxonomies' ) ) , '(-)' ); } $title = html( 'h4', $title ); $title = apply_filters( 'qmt_term_list_title', $title, $taxonomy, $query ); $out .= html( "div id='term-list-$taxonomy'", $title .html( "ul class='term-list'", $list ) ); } $out .= self::reset_button(); return $out; }
http://wordpress.org/extend/plugins/query-multiple-taxonomies/
- The topic ‘[Plugin: Taxonomy Drill-Down] Can QMT Widget exclude terms outside current taxonomy?’ is closed to new replies.