Query Multiple Taxonomies
[resolved] Multiple taxonomies within page template (3 posts)

  1. bakuhatsu
    Posted 6 years ago #

    Hi Scribu,

    Thanks for the fantastic plugin!
    Just a quick question, how can I use QMT within my design templates?

    If I use "index.php?genre=horror&age-certificate=18" then QMT does return the correct list of posts. However, in my template I am trying to display a list of posts from the custom type 'movie', that match a specific taxonomy e.g.

    $relatedMovies = new WP_Query();
    $relatedMovies->query(array( 'post_type'=>'movie', 'posts_per_page'=>'-1','caller_get_posts' => 1, 'order'=>ASC, 'orderby' => 'name', 'genre'=>'horror', 'age-certificate'=>'18'));

    This will return only 'horror' movies, the second taxonomy call is ignored completely. I'm sure I had it working correctly at one point but I am unsure of why it is no longer working.

    I am currently using the development version of QMT because the latest non-development version causes an error with WP3 menus (it replaced each menu item with the posts returned by QMT!)

    Thanks for any help.

  2. scribu
    Plugin Author

    Posted 6 years ago #

    Because of the menu problem, I limited the plugin to only the main query.

    In other words, it will only work if you use query_posts().

    Just remember to call wp_reset_query() afterwards and you should be fine.

  3. bakuhatsu
    Posted 6 years ago #

    Fantastic, it's all working again!

    Many thanks.

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