Query Multiple Taxonomies
Seperate Template for QMT Queries (1 post)

  1. tkhan
    Posted 2 years ago #

    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 http://wordpress.org/support/topic/display-filtered-results-on-custom-template.

    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?



Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Query Multiple Taxonomies
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic