WordPress.org

Ready to get started?Download WordPress

Forums

Query Multiple Taxonomies
[resolved] Stopped "stacking" taxonomies after upgrade (12 posts)

  1. thedimsumkid
    Member
    Posted 4 years ago #

    Help! After upgrading to the latest version f the plugin, it seems to have stopped working!

    Clickin g on the '+" no longer "stacks" the taxonomies together but only displays that taxonomy only (i.e. it's as if pressing the taxonomy itself rather then the +)

    Hope you can help!

  2. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    It's working correctly for me.

    What do you mean by "the latest version"? Try the development version (1.3-alpha).

    If that doesn't help, are you using query_posts() or a custom loop in your theme?

  3. Buster
    Member
    Posted 3 years ago #

    Hey.

    I think that I am having the same problem as dimsum.

    I am running the development version of QMT, and have the widget set up for three taxonomy fields. But the output is always just the final taxonomy chosen. It's as though I chose just the one taxonomy.

    You can see what I mean here, the "Find a Restaurant" widget.

    I am using a custom loop in my theme, to answer dimsum's question.

    Thanks!

  4. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    Buster, make sure you're running the latest dev version (currently 1.3.1-alpha3). Just re-download from the link above.

    Also, please post the loop.

  5. Buster
    Member
    Posted 3 years ago #

    Hey Scribu.

    So, I read that GD tools can conflict with your plugin, so I deactivated it and now QMT works! It's awesome.

    Why is it that GD tools conflicts with your plugin?

    Also, and sorry I don't how to explain this clearly, but I have three taxonomies set up to search. When there is a post that matches all three, it works perfect. But when there isn't a post that matches, I am taken to a 404 page. Is there a way for me to customize the 404 page just for these searches and not site-wide?

  6. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    So, I read that GD tools can conflict with your plugin, so I deactivated it and now QMT works! It's awesome.

    Why is it that GD tools conflicts with your plugin?

    Well, the topic where you read that also has an explanation for it.

    Is there a way for me to customize the 404 page just for these searches and not site-wide?

    Yes, there is. Add this to your functions.php file:

    function tax_404() {
      $query = qmt_get_query();
    
      if ( !empty($query) && is_404() )
        locate_template( array('tax-404.php', '404.php'), true );
    
      die;
    }
    add_action('template_redirect', 'tax_404', 20);
  7. Buster
    Member
    Posted 3 years ago #

    Scribu, thanks! I respect your patience.

    But, that function didn't work. The site just resolves now to a blank page.

  8. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    Here's a corrected version:

    function tax_404() {
    	if ( !function_exists('qmt_get_query') )
    		return;
    
    	$query = qmt_get_query();
    
    	if ( is_404() && !empty($query) ) {
    		locate_template( array('tax-404.php', '404.php', 'index.php'), true );
    		die;
    	}
    }
    add_action('template_redirect', 'tax_404', 20);

    You need to create the tax-404.php file in your theme folder to see the effect.

  9. Buster
    Member
    Posted 3 years ago #

    Thanks, Scribu, that works.

    OK. Last question, cause I am a newbie too close to having an AWESOME widget....

    I would like to style the result pages that occur from the query differently than the rest of the site, but I am not sure how to do that. Are the results pages a specific template? Likewise, I am confused by the URL structure: /?"tax"="term"&"tax_2"="term".

    And if I should just do my own research, maybe you could point me in the right direction? Thanks.

  10. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    The template loaded is taxonomy.php.

    Also: http://codex.wordpress.org/Theme_Development

  11. Buster
    Member
    Posted 3 years ago #

    Hey Scribu! Now I know what I am dealing with:

    The thing that I can't figure out is the resulting URL from the plugin's query, when there is only one taxonomy, seems to be rewritten, so that it is site.com/taxonomy. But when there are two or more taxonomies chosen there is no rewrite system, and the URL comes out with as the raw query string. Is there a way to change that so that the URL is, like, site.com/taxonomy1/taxonomy2/taxonomy3/ ?

    Thanks.

  12. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    That would actually have to be:

    site.com/tax1/term1/tax2/term2 etc.

    It's possible, I think, but I'm not keen on messing with the rewrite system at this point.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic