Skip Navigation

[Resolved] Searching a custom post types relationships using text field filter

This support ticket is created 4 years ago. There's a good chance that you are reading advice that it now obsolete.

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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Author
Posts
#1568471

I'm trying to filter a custom post type (Projects) using a text-based search field. I would like the filter to look at the relationship fields of the Project. In this case, a Project custom post type has a many to many relationship with the custom post type People.

For example, on hidden link, if someone searches "John", all the Projects that have a relationship with John should show up in the search results.

Is this possible? If not, is there an alternative solution?

Thanks,
Austin

#1569283

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Austin,

Thank you for contacting us and I'd be happy to assist.

At the moment, post-relationships are not covered in text-based search filters in post views, but you're welcome to submit this as a feature request:
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/

The post-relationship search filters work in form of a select type field, as explained in this guide:
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/how-to-filter-posts-by-their-ancestors/

One workaround can be to store the title of the related posts, in a single line type custom field. After that, you'll be able to use the "Relevanssi" plugin to extend the default text-based search feature to also include the values from that custom field:
https://toolset.com/documentation/user-guides/views/searching-texts-custom-fields-views-relevanssi/

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#1569871

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.