I think the issue here is you’re using the relation where you only have one inner tax array. So, it should be without one.
$tax_query = array(
array(
'taxonomy' => 'city',
'field' => 'slug',
'terms' => array( 'belgrade' )
)
);
Here’s a detailed explanation from WP: Taxonomy Parameters
- relation (string) – The logical relationship between each inner taxonomy array when there is more than one. Possible values are ‘AND’, ‘OR’. Do not use with a single inner taxonomy array.
Related Posts:
- How to support multiple search terms query within one process?
- Modifying the Search Results
- wp_query ‘s’, search filter with pagination is not working
- Display filtered results into custom page
- Post_count only shows the number of results per page
- WP Query where title begins with a specific letter
- Whats the difference between post_limits and pre_get_posts?
- How to add taxonomy filter on the query fly?
- Order Search Results Page by meta_value If no Value Return Remaining Results
- Tracing the life of a query
- Ignore a filter on the media library
- Pagination not working for Custom search form & custom result template
- Pagination broken when merging search results with additional WP_Query
- Multiple keyword search
- Using next/previous_posts_link with customised search
- Which filter/action hook gets triggered after a query has been performed?
- Removing posts from the returned wp_query. Cannot use object of type WP_Query as array
- WP Query search for attachments and their exact title
- What is considered a default query for the request filter?
- How to find exact match for search term in WP_Query? What is the additional string added in LIKE query in WP_Query?
- Query total number of posts
- Creating a custom search for a specific post type
- How to add post_distinct filter to WP_Comment_Query?
- Custom Search Result Page displaying only 1 result.
- Using Ajax to load more posts | Help me change the wording on my button to notify the user
- Querying on multiple taxonomies pulled from $_GET checkbox array not working?
- Is there any advantage of using default WordPress Search instead of creating a custom one?
- Search pages that are a child of the current page
- Include tags in WP_Query
- Search for multiple tags?
- Custom Search Not Consistent with Results
- Order by title without taking into account ‘the’
- How to use wp_query to post count by search term > group post count by date > convert to json. (ex. result 12-21-2020 – 343)
- How to filter, restrict and return posts based on custom user meta information
- Filter posts in category archive page by year using a dropdown
- Extend product search with meta in WooCommerce
- Query with search and subscribers only output
- Applying posts_clauses filter to specific queries only
- Add class to first post in custom loop using post_class filter
- how to access query string in wordpress?
- Modify Search Query if original Query gave no results
- Filter Custom Taxonomy Posts
- Include post content of linked posts in search
- How do I amend wp_query before it is run/executed?
- wp_query search not taking keywords with together for multiple words
- Filter post query to only show direct children of category
- How to make posts unqueryable/unpublish posts where ACF relationship field is an unpublished post? [closed]
- How to properly use AND / OR in custom search
- Change AJAX filter from POST to GET for URL Parameters
- Using post_where filter only on main query NOT sidebard new WP_Query
- How to avoid bypass of search bar rules?
- Filtering posts by archive showing all years
- Hide products in uncategorized category from search results
- How do you determine if a result in a search query is a post or a page?
- wp_query show all values
- Remove post type filter added by the plugin in the final query
- How to restrict search on a certain page to only return results against custom taxonomies?
- relation OR instead of AND – Filtered term ID’s in loop
- Can’t order the query result as given posts id’s array
- Ignore image urls in wp_query search
- filter posts by meta key with pagination
- Why does apply_filters behave different inside and outside a loop?
- How can I modify this code to make the search box include tags and meta
- Filter sub-category from checkbox form
- How to prevent WP_Query from filtering on ‘s’ but keep ‘s’ for other purposes?
- How to add a “base” filter for all posts visible to visitors on the site?
- Add dynamic search to paginated WP_Query
- Multiple WP_Query args combinations according to post type
- Display the search results like the original pages
- How to use jQuery validation to set the search bar to accept only a specific input?
- Query Posts | Combining multiple form inputs into query arguments to generate one filter result
- Sorting query_posts() with a complex orderby filter
- WordPress search page pagination displaying but not functional
- WP Query filters active on wrong query
- Limit default Search query to post_title
- Gather same custom field values in one value in a select tag with wp_query
- Order & Orderby clause not working with custom query
- How can I modify standard search query to include also ACF custom fields values?
- WP_Query doesn’t works inside loop
- How to make the default WordPress search return borader results
- WordPress WP_Query offset parameter not working with search parameter
- Add filter to Orderby Parameter using Array
- Need help setting up a search form for wordpress [duplicate]
- query post based on comparison
- Custom search: Search posts but display parent page in results
- Do not show a custom post if it belongs to a certain custom taxonomy
- Query posts by custom fields
- Searching in specific custom post type
- wp_query->set for several categories
- Adding arguments to WooCommerce Product Loop using AJAX
- Help with showing text when something is entered in my search bar
- Filtering product search results using tags
- List categories using WP_Query
- WordPress WP_Query Search (‘s’) With Multiple Search Terms
- Search query alteration not working for meta values
- Search results stuck on page 1
- Advanced Search – Is this possible?
- How to include custom fields in wordpress search
- Extend search query to search meta keys values based on search string
- AJAX multiple search boxes not merging with array merge