I've got two taxonomies: "type of guide", and "tools".
They look something like this:
Type of guide
- Article - Video - Cheat sheet
— Learning Management System
- Hide a grades column (article) - Creating a Gradebook (article) - Long Answer Question Steps (article) - Matching Questions (article) - True or False (article) - Using the Quiz Tool (video) - Using the Quiz Tool (cheat sheet)
- Grades Tool
The screenshot outlines the problem perfectly: I need to limit that tax-query to include only items that are tagged with "Quiz Tool".
I'm trying to do it with a tax_query, with an AND relation:
$args = array( 'tax_query' => array( 'relation' => 'AND', array( 'taxonomy' => 'guide-type', 'field' => 'slug', 'terms' => 'video' ), array( 'taxonomy' => 'tool', 'field' => 'slug', 'terms' => what do I put here to get the current tool (Quiz tool)? ) ) ); $query = new WP_Query( $args );
But I just can't figure out how to limit to only list items that are tagged with "Quiz Tool". Note the, "what do I put here" part.
It just occurred to me that I don't have to query both taxonomies, instead exit the tax_query and use a 'get_the_category()' as part of the $args:
// The Query $args = array( 'tax_query' => array( array( 'taxonomy' => 'guide-type', 'field' => 'slug', 'terms' => 'self-paced ' ) ), 'category_name' => get_the_category()
Something like that? Any ideas how I could limit that 'category_name' to be the current one I'm looking at (Quiz Tool).