I currently have a checkbox based search and filter on my wordpress site.
Basically it works using this wp_query
$queryObject = new WP_Query(array("post_type"=>'toy','posts_per_page'=>999999, 'category__and' => $_POST['myListOfCategories']));
I want to move away from using categories (as it’s making using the blog a pain)
So I’ve set everything up using custom taxonomies now and notice there is no “taxonomy__and”.
Does anyone know of a way to use WP_Query to search for posts using taxonomies in the same way category__and and works?
e.g. I pass multiple taxonomy id’s and it only returns posts which have all of them linked.
From http://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters
You should be able to use something like this;
You have pass multiple taxonomy in Query_posts in WordPress
See below URL It is very help full to you:-
https://wordpress.stackexchange.com/questions/25999/how-to-pass-url-parameters-for-advanced-taxonomy-queries-with-multiple-terms-for
https://wordpress.stackexchange.com/questions/10713/wp-3-1-getting-tax-query-to-work-in-query-posts
Query multiple custom taxonomy terms in WordPress 2.8?
or try it
With the help of the other posters here is the final answer to my question:
The above code will only show posts that have the “toy” post type, is in the taxonomy “toy_cats” and is is assigned to ALL the following term id’s 14 AND 20 AND 39 AND 42
Hope this helps someone else.