WordPress.org

Forums

Query Multiple Taxonomies
[resolved] [Plugin: Taxonomy Drill-Down] Does 1.4 mean I can't do ?genre=jazz&artist=Chet+Baker any mo (20 posts)

  1. pokes
    Member
    Posted 4 years ago #

    Just updated to v1.4 and my ?genre=jazz&artist=Chet+Baker type queries stopped working, how do I do that now?

    http://wordpress.org/extend/plugins/query-multiple-taxonomies/

  2. scribu
    Member
    Plugin Author

    Posted 4 years ago #

    Please paste an exact query, since artist=Chet+Baker would look for a post that has both the terms Chet and Baker.

    A correct query would be artist=chet-baker.

  3. pokes
    Member
    Posted 4 years ago #

    Oh, that was your example :-)

    I mean 1.3 let me do ?genre=rock&artist=beatles (as a URL link), but it seems like 1.4 doesn't. (is this now supposed to be in the core?)

  4. scribu
    Member
    Plugin Author

    Posted 4 years ago #

    Yes, WP Core is supposed to handle that now. What happens instead? 404 or...?

    PS: You are running WP 3.1, right?

    (updated the example)

  5. pokes
    Member
    Posted 4 years ago #

    Yes WP3.1

    Without v1.3, or with v1.4, my second parameter gets ignored.

  6. Primitive
    Member
    Posted 4 years ago #

    I've got the same problem, the first terms drills down nicely and limits the choices of the second term, but the second term just gets ignored.

    Example @ http://bit.ly/dYPNTH

  7. pokes
    Member
    Posted 4 years ago #

    Any advice on this scribu? Do I need to stay with v1.3 for this functionality? Not working in the core or do I need to enable it or modify my query somehow?

  8. scribu
    Member
    Plugin Author

    Posted 4 years ago #

    For me, version 1.4 is working just fine with multiple taxonomies selected.

    To clarify: the URLs generated by the widget are correct, right?

    Try switching to the twentyten theme.

    Then, try disabling other plugins.

  9. mark7694
    Member
    Posted 4 years ago #

    I'm having the same problem. Selecting multiple taxonomies but it's only registering the second selection. The URLs aren't generating correctly. It's only creating the URL based on the last selection.

  10. thecorkboard
    Member
    Posted 4 years ago #

    Similar story for me, but switching to TwentyTen DOES fix the problem:
    http://wordpress.org/support/topic/plugin-query-multiple-taxonomies-array-bug-in-url?replies=8#post-2101067

  11. pokes
    Member
    Posted 4 years ago #

    Narrowing this down!

    In going from v1.3 to v1.4 my template hierarchy has gone from:
    taxonomy.php -> archive.php -> index.php
    to:
    taxonomy-{taxonomy}.php -> taxonomy.php -> archive.php -> index.php

    which is why I'm only seeing results for one of my taxonomies.

    Any ideas why this might be? And why only one taxonomy (the first registered?) and not the other?

  12. pokes
    Member
    Posted 4 years ago #

    - v1.3 used scribu-code for multitax queries, so the hierarchy was:
    taxonomy.php -> archive.php -> index.php

    - v1.4 relies on core code, so the full taxonomy hierarchy is used:
    taxonomy-{first-registered-taxonomy}.php -> taxonomy.php -> archive.php -> index.php

    Scribu can you confirm this?

  13. scribu
    Member
    Plugin Author

    Posted 4 years ago #

    Yes, the first one is actually taxonomy-{taxonomy}-{term}.php, then taxonomy-{taxonomy}.php.

    A multiple-taxonomy.php file would certainly be useful, but the problem is that when there's actually a single taxonomy being queried, you can't make a distinction.

    Unless... you could add an additional query arg:

    ?color=blue&qmt=1

  14. pokes
    Member
    Posted 4 years ago #

    I assumed multiple taxonomies would use taxonomy.php, as there is nothing more specific for both query args, rather than picking one seemingly at random and using that.

    So are my only options:

    1. Have multitax code in all taxonomy-{taxonomy}.php files?
    2. Have all taxonomy code in taxonomy.php and don't use taxonomy-{taxonomy}.php files.

    Or is there a better way?

  15. scribu
    Member
    Plugin Author

    Posted 4 years ago #

    You can use taxonomy-{taxonomy}.php files only for taxonomies that you don't plan on using with QMT.

    The better way would be the mutiple-taxonomy.php template I mentioned.

  16. scribu
    Member
    Plugin Author

    Posted 4 years ago #

    Alternatively, you could manually load multiple-taxonomy.php from each of the taxonomy-{taxonomy}.php files that would be involved with the QMT widget.

  17. pokes
    Member
    Posted 4 years ago #

    Oww that's quite a limitation, no taxonomy-{taxonomy}.php if you want to QMT :-(

    Are you suggesting I can make multiple-taxonomy.php be higher in the template hierarchy than taxonomy-{taxonomy}.php somehow?

  18. pokes
    Member
    Posted 4 years ago #

    Posted at the same time... cool how could I do that?

  19. scribu
    Member
    Plugin Author

    Posted 4 years ago #

    So, in each taxonomy-{taxonomy}.php template you would have a single line:

    require_once( dirname(__FILE__) . '/multiple-taxonomy.php' );

    In order to make multiple-taxonomy.php the first item in the template hierarchy, I would need to make some modifications to the plugin, as described here.

  20. pokes
    Member
    Posted 4 years ago #

    Excellent, thanks Scribu, with your great assistance I've finally found an acceptable workaround solution to this problem after 3 months!

    I check for multiple query args at the top of my taxonomy-{taxonomy}.php and then locate_template( 'multi-taxonomy.php', true );

    I look forward to something more permanent if you are able to provide it!

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