Problem: I have two custom post types in a many-to-many relationship. I would like to create a View that is filtered by custom field of a post relationship so I can display specific related posts.
Solution: You must make the intermediary post type visible in wp-admin. If it is not visible, go to Toolset > Post Types and edit the intermediary post type. In the "Options" panel, make sure "show_ui" is checked.
Now create a View and select the intermediary post type in "Content selection". Add the custom field filter in Query Filters. If you cannot see the Query Filters panel, scroll to the top right corner and click "Screen Options" to activate the Query Filter panel. After you add the custom field filter, add a post relationship filter using your M2M relationship. Set it such that the related Place is set by the current post. In the View's Loop wizard you can use the "edit" button to show information like the title of a related post (edit-field.png, post-selection.png). This will allow you to display information from the Business related to the current intermediary post. Finally, place the View in your template for Places.
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 2 replies, has 2 voices.
Last updated by 5 years, 10 months ago.
Assisted by: Christian Cox.