The solution: Add ‘operator’ => ‘AND’, to the tax_query.
'tax_query' => array(
'relation' => 'OR',
array(
'taxonomy' => 'offer',
'field' => 'slug',
'terms' => array($offer),
'operator' => 'AND',
),
array(
'taxonomy' => 'network',
'field' => 'slug',
'terms' => array($network),
'operator' => 'AND',
),
Related Posts:
- relation OR instead of AND – Filtered term ID’s in loop
- WordPress – Form does not filter the results of taxonomies
- Use REGEXP in WP_Query meta_query key
- WP Job Manager plugin – Listing only the twelve job categories on frontpage order by jobs they have
- Change AJAX filter from POST to GET for URL Parameters
- Using post_where filter only on main query NOT sidebard new WP_Query
- Filtering posts by archive showing all years
- WP_Query – How to get all posts of specific days of week by custom field date?
- Get posts in taxonomy randomly
- Loop posts based on permalink term
- How to echo woocommerce category name
- Multiple wp_query on archive page
- Retrieve select tag custom values from array and display them in current page with wp_query?
- How to use a dropdown to filter posts by custom field
- Remove post type filter added by the plugin in the final query
- WP Query – filtering terms with regex
- How to get posts by category and by choosing a taxonomy term?
- Filtering by multiple conditions in the loop
- Can’t order the query result as given posts id’s array
- Don’t repeat posts from children in parent taxonomy query
- filter posts by meta key with pagination
- Why does apply_filters behave different inside and outside a loop?
- Show multiple tax_query from 2 or more post_type in a single code
- Custom taxonomy in WP_Query not working
- Custom post type – filter content by custom meta box content
- get_the_terms has strange result since version 6.0
- meta_query weird behaviour, static int will work, but not user data
- Can’t get term id for category archive
- How to make a post with certain taxonomy term display first before other post with only one query?
- Filter sub-category from checkbox form
- Exclude post with taxonomy and from the terms (taxonomy & tag) posts count
- Use get_cat_ID to retreive multiple category IDs
- Display posts ONLY from the current logged in user and current week/year/month Elementor posts
- My combination of ‘post_type’ and ‘tax_query’ not working?
- Strange behaviour of hierarchical taxonomy archive
- Custom meta_query order for Elementor based on post meta key [closed]
- How to add a “base” filter for all posts visible to visitors on the site?
- How can I order a post query’s results based on the number of matching taxonomy terms?
- WP Query should show No Posts when tax_query $args taxonomies don’t have associated posts
- Only show tag with the same id as the post
- tax_query not working on custom post type
- Save queried result into database
- How to use the Term Object from a custom select field in a query
- WooCommerce WP_Query using tax_query returns no results (0 = 1)
- wp_query with meta_query and tax_query
- WP_Query paginate with one term per page?
- Show one post of each custom taxonomy
- Query Posts | Combining multiple form inputs into query arguments to generate one filter result
- Sorting query_posts() with a complex orderby filter
- How to break up output of posts for different terms on same page?
- WP Query filters active on wrong query
- Taxonomy archive, categorised by other taxonomy, not hiding empty taxonomies
- Insert wp_query after the_content with plugin (filter the_content won’t work)
- taxquery taxonomy get terms
- pages shortcode filtering by category
- Gather same custom field values in one value in a select tag with wp_query
- get term objects and post objects in query
- How to show terms from another taxonomy
- How to define a custom hierarchy for terms?
- How to set selected attribute on option after filter query?
- Taxonomy Terms That Don’t Exist Display Results
- Issue generating custom filter for cpt admin columns
- WP_Query doesn’t works inside loop
- Track write actions to the database
- Category Archive not working for pages
- How can I get all the posts that are related with a specific taxonomy term?
- Fetch only categorized posts
- Custom taxonomy and query multi conditions
- WP Query with sticky posts and tax_query
- Empty ‘terms’ in ‘tax_query’ returns an empty array
- Custom query with post_class filter using current_post not working
- Search format not matching taxonomy query
- Add filter to Orderby Parameter using Array
- Filter WP_Query output before it is accessed (pre_get_posts)?
- Get the tax term in which is a post via wp_query
- Loop the posts between two dates selected using jquery datepicker
- query post based on comparison
- Do not show a custom post if it belongs to a certain custom taxonomy
- wp_query->set for several categories
- Adding arguments to WooCommerce Product Loop using AJAX
- Multiple Orderby is not working right
- tax_query not working properly with get_posts
- Edit WordPress loop, taxonomies, & filter
- Woocommerce set loop_shop_columns to be 3 in the main shop page loop only and 4 otherwise
- List categories using WP_Query
- Custom query for certain post type OR another post type with a certain category
- How can I get taxonomy term name using term slug & post ID using build in WordPress function or class?
- I need to get all categories from a WP_Query
- Using WP Query, I want to include all posts in category 1 as long as they are not also in category 2
- WP_Query filter Posts by timestamp event (range start and end) and by month (next 12 month)
- Filter on one post type with taxonimy and get other post type
- filter the custom post type using wp ajax request
- WP_Query filtering in ACF field containing dates
- Loop a Single Taxonomy and Output all Posts Associated (but also show a message for empty ones)
- Query top level custom post in taxonomy
- Include custom post type that matches taxonomy field in another custom post type
- Grab IDs of products from WP_Query which is run elsewhere
- Showing all posts of the current custom taxonomy on archive page
- Need help with Query Loop. Need to get current taxonomy term and its posts and group them by a different selected taxonomy term
- Custom tag template to list posts in ASC order