(Fairly new to WordPress, but I'm a React / NodeJS developer)
I have a basic search function that search a custom post_type
(listings
).
It makes use of the standard built in get_search_query
and therefore it can only find the title of a listing
- we want the search to search through the taxonomy as well.
The search URL looks as follows, http://localhost:8888/?s=New+York&post_type=listings
- basic.
The post_type=listings
is defined as a hidden input in the form, eg <input type="hidden" name="post_type" value="listings" />
We have custom taxonomy in each listing
eg, location
and tag
.
After a lot of googling, I think you cannot search custom taxonomy by simply adding extra tags - at least Taxonomy is not that magical and I'd have to write a script in my functions.php.
Any suggestions on where to get started writing a custom query?