Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I build a review site with Wordpress. I created a custom post type called "Reviews", inside this, theres two taxonomy, one called "Genres" and one called "Types". Inside the Genres, i have a couple of subcategory, action, comedy, drama etc... and inside the Types, i have 2 subcategory: Movies and TV Shows

I want to create a navigation on my homepage like this:

  • Movies
    • Action
    • Comedy
    • Drama
  • Tv Show
    • Action
    • Comedy
    • Drama

And of course, if i click on the Tv Shows/Action, i only want to display all of the reviews inside the Tv Shows category which has an Action genre, and only the TV show, not the movies.

What is the easiest solution to do this?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

The way that I would approach it is using the tax_query to create a query that looks for both the correct genre and type. For example, to query all Movies that are Drama:

$myquery['tax_query'] = array(
    array(
        'taxonomy' => 'genre',
        'terms' => array('drama'),
        'field' => 'slug',
    ),
    array(
        'taxonomy' => 'type',
        'terms' => array('movie'),
        'field' => 'slug',
    ),
);
query_posts($myquery);

Hopefully that will get you started in the right direction.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.