How to build a multi-taxonomy, multi-term query based on user input

Thanks to Otto’s excellent post on advanced taxonomy queries, I (mostly) understand how to create multi-taxonomy and multi-term queries. However, what I don’t know is how to build those dynamically based on user input. I’d really like to end up with something like Amazon.com has on their site, with check boxes next to the various … Read more

How to choose which template to be used for multiple taxonomy query?

Since 3.1 WordPress support multiple taxonomy query. The question is : If I have a two taxonomy query, e.g: http://localhost:8888/site/?lot-term=australia&story-type=note how can I determine which template to be used for the query? On the first try, it loads taxonomy-lot-term.php, but after I re install the theme, it loads taxonomy-story-type.php instead. After some experiment, I found … Read more

wp_get_object_terms() to get a list of all the terms attached to all the posts in the current query

How can I use wp_get_object_terms() to get a list of all the terms attached to all posts in the current query? For example, for the current query I want to get an array of the terms from the “Alfa” taxonomy that are contained in all the queried posts. wp_get_object_terms($wp_query, ‘alfa’); But that only seems to … Read more

Filter posts by multiple custom taxonomy terms using AND operator in REST API v2 (WordPress)

I’ve created a custom post type called ‘events’. I’ve also created a custom taxonomy called ‘event_categories’ containing the 12 months of the year. I am trying to get ‘events’ held in August AND (not OR) September (term IDs 41 and 42) using the following urls: /wp-json/wp/v2/events?event_categories=41,42 /wp-json/wp/v2/events?event_categories=41+42 For some reason these urls return the same … Read more

Using multiple taxonomies to sort Custom Posts

I have a post type that includes a taxonomy for (1) location and (2) a day of the week. I’m using the first taxonomy to sort the posts into groups. Here’s the loop I’m using: <?php $terms = get_terms(‘cell-locations’); $argv = array( ‘orderby’ => ‘by_term’, ‘hide_empty’ => false ); foreach ($terms as $term) { $wpq … Read more

How to add images to taxonomies?

Q: Is it possible to add images to all of my taxonomies (default and custom ones)? Note: I do not want to use any plugins (not my favourite solution for design related matters). Usage: I want to create really practical custom post type portfolio with custom taxonomies. For example, custom taxonomy – clients, so if … Read more