Hi,
Thank you for contacting us and I'd be happy to assist.
For the approach suggested by Christian to work, it is important that the data entry part in those 3 custom fields is correct.
You'll need to make sure that In every post, the correct association data exists when it comes to the country, state, and city. If you're seeing the incorrect state or city when a country is selected, it is most likely because, in at least one of your posts, the incorrect country, state, the city has been entered.
To troubleshoot this, you can temporarily add single field blocks to show the added country, state, and city for each post in the view and you'll have a better overview, of why this is happening.
In case the data entered is correct and the issue still persists, you're welcome to share temporary admin login details, in reply to this message.
Note: Your next reply will be private and please make a complete backup copy, before sharing the access details.
Another alternative to using the 3 custom fields approach, would be using the 3 custom post types and then linking them together using the 1-to-many post-relationships.
( ref: https://toolset.com/course-lesson/what-are-post-relationships-and-how-they-work/ )
1. Custom Post Types
- Countries
- States
- Cities
2. Relationships
- One country can have many states
- One state can have many cities
- One city can have many posts that you're showing through the view.
With the data entered in this structure, you'll be able to show the 3 connected search fields (for countries, state & city), using the post-relationship filter in the search view.
regards,
Waqar