Support » Plugin: Query Multiple Taxonomies » Seperate Template for QMT Queries

  • Is there anyway to have QMT queries appear on their own template. I have tried adding the following code to my functions.php as suggested by scribu at

    function document_taxonomy_template() {
      $queried_taxonomies = array_keys( qmt_get_query() );
      $matching_taxonomies = array_intersect( $queried_taxonomies, array( 'taxonomy-a', 'taxonomy-b', 'another-taxonomy' ) );
      if ( !empty( $matching_taxonomies ) ) {
        locate_template( 'document-taxonomy.php', true );
    add_action( 'template_redirect', 'document_taxonomy_template', 11 );

    This does exactly what it says and redirects any queries on the listed taxonomies to the specified template. I was wondering if this could be adapted so that only QMT queries are redirected but not the links to my taxonomy and term archives.

    Alternatively is there any way I can determine if the current page is the result of a QMT query.

    Any Ideas?


  • The topic ‘Seperate Template for QMT Queries’ is closed to new replies.