Problem: I would like to include a text search that allows visitors to search for custom posts. I would also like the search to index related posts, so if the visitors sort by parent post title the search should return the related child posts.
Solution: Text search does not currently index related posts, so you could add a post relationship filter to a View of Properties, and let your visitors select an agent by name. Then display the matching Property results.
Or, you could use custom code to copy the Agent's name into a custom field on the property post whenever a Property and an Agent are related to one another. We offer the post relationships APIs toolset_association_created and toolset_before_association_delete to tap into these relationship events. Once that is set up, you can use Relevanssi to add that custom field to the search index. This would allow give you the ability to use a text search field to search Properties by Agent name.
Relevant Documentation:
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_association_created
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_before_association_delete
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - | - |
13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - | - |
Supporter timezone: America/New_York (GMT-04:00)
This topic contains 3 replies, has 2 voices.
Last updated by 5 years, 10 months ago.
Assisted by: Christian Cox.