Hi,
Could you please elaborate the issue a bit more?
As I understand the city is taxonomy and what is doctor? I mean city should match with taxonomy then the doctor should match title, custom field or other taxonomy? Please explain.
Thanks
Hi! Alright?
I need one field to validate the other. The site searches for doctors in cities. The user can search only by doctor name or doctor name + city where he works.
Ex 1: Doctor > The result will be from all registered doctors
Ex 2: Doctor + City> The result will be for all doctors in that city
Hi,
Sorry but that is not my question. My question is where you have entered the doctor name post title, custom field, taxonomy?
You have mentioned that city is taxonomy but I want to know what is field type for doctor name?
That would be good if you can share the screenshot of your WPES setting and the edit post screen where you have created doctors.
Also, please share the search query that I can try on site to see the results. Your site is in pt-br so please provide the query in same language.
Thanks
Sorry, now I get it.
Yes, the doctor’s name is filtered through the post title and the city is a meta key, according to the prints.
=================
Print 01: https://www.cllinix.com.br/wp-content/themes/cllinix-2/assets/help/print_01.png
Print 02: https://www.cllinix.com.br/wp-content/themes/cllinix-2/assets/help/print_02.png
Print 03 (The code): https://www.cllinix.com.br/wp-content/themes/cllinix-2/assets/help/print_03.png
=================
Website: https://www.cllinix.com.br/
The search field by city is disabled because it is not working.
Hi,
Thanks for the details. As I can understand the post contains all the doctors and city is post meta. Then if you search just city name it will list all the post with that city name. For example https://www.cllinix.com.br/?s=psiquiatria&wpessid=1537
Also, if you want “doctors in psiquiatria” to bring correct search results then we need to remove the doctors from query because it has no meaning. You can modify this code to remove the doctors from query https://ww.wp.xz.cn/support/topic/doesnt-work-if-search-phrase-includes-parenthesis/#post-14998493
Basically this line
$q->set('s', str_replace(['doctors', 'doctor'], ['', ''], $search_term));
Hope it helps.
Thanks