Support » How-To and Troubleshooting » [Resolved] Multiple Tag Search?
3 years, 7 months ago
I don’t think I’m searching this properly.
If a post has tags “This” and “that” you will get results if you search for “This” OR “That”.
But if I search “this that” I see that I’m getting no results found. Whats the best way to set up a query for multiple tags?
This is a custom post type, so multiple terms is actually more accurate. Not tags. term+term+term returns nothing.
I’ve found similar answers…
But it seems my query is returning empty still.
$local_query = array(
'posts_per_page' => $results_per_page,
'paged' => $paged,
'post_type' => 'image',
'image-tags' => $image_tags,
'image-type' => $category,
'tax_query' => array(
'taxonomy' => 'image-tags',
'field' => 'slug',
'terms' => explode(' ', $image_tags),
'operator' => 'IN'
Solved it. Looks like ‘post_type’ => ‘image’, and ‘image-tags’ => $image_tags, had to be removed.