Problem: I would like to be able to use text search to find posts using information stored in repeatable field groups. However, when I add RFGs to the index I see links in the search results that point to an invalid post. I would like to link to the post containing the RFG.
Solution: Add the repeatable field group to the search index, then use a WordPress Archive to display the search results. Use conditional HTML in the archive to determine if the link is for a RFG post type, and display a link to the parent post instead. Something like this:
[wpv-conditional if="( '[wpv-post-type]' eq 'custom-page-section' )"] [wpv-post-link item="@custom-page-section.parent"] [/wpv-conditional] [wpv-conditional if="( '[wpv-post-type]' eq 'custom-post-section' )"] [wpv-post-link item="@custom-post-section.parent"] [/wpv-conditional] [wpv-conditional if="( '[wpv-post-type]' ne 'custom-page-section' ) AND ( '[wpv-post-type]' ne 'custom-post-section' )"] [wpv-post-link] [/wpv-conditional]
Relevant Documentation:
https://toolset.com/documentation/user-guides/searching-texts-custom-fields-views-relevanssi/
https://toolset.com/documentation/getting-started-with-toolset/customize-post-archives/
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.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
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 28 replies, has 3 voices.
Last updated by 5 years, 11 months ago.
Assisted by: Christian Cox.