Problem: I have two custom post types in a one-to-many relationship. Each custom post type has a different custom taxonomy. On the parent post page, I would like to display a list of child posts filtered by taxonomy term. The terms in the two taxonomies are identical, but the taxonomies are different.
Solution: Create a View of the child post type, filtered by the taxonomy applied to the child post type. Use a shortcode attribute to set the term slug filter. Place the View in the single parent post template, and use the shortcode attribute to pass in the parent post's term slugs using the wpv-post-taxonomy shortcode:
[wpv-view name="Your SubGroup View Name" wpv-subgroup="[wpv-post-taxonomy type='group-taxonomy-slug' format='slug' separator=',']"]
Relevant Documentation:
https://toolset.com/documentation/user-guides/passing-arguments-to-views/
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-taxonomy
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, 9 months ago.
Assisted by: Christian Cox.