Problem: I would like to create a dictionary-style site where each definition is a post in a custom post type. On the single definition page, I would like to show links to related definitions.
Solution: Use a custom taxonomy instead of a custom field. Create a term for each definition. Make sure the slug of the term matches the slug of each definition post.
Think of this taxonomy as "Where I want this Definition to appear as a related Definition". If you want to show Definition B and Definition C as related terms on the Definition A single post page, you must edit Definition B and Definition C. In both of these Definitions, you must select the term that matches Definition A in your custom taxonomy.
The relationships you define in each Definition only work in one direction, so if you want to show Definition A as a related term on the Definition B page, you must edit Definition A and select the term that matches Definition B.
Next, create a View of Definitions. Filter this View by your custom taxonomy, and select the option to supply a taxonomy term by shortcode URL. In this example, the shortcode parameter is wpvdefinitionrelationship. Place this View on your Definition Content Template or Layout. Use the [wpv-post-slug] shortcode to supply the relationship taxonomy term value:
[wpv-view name="related-definitions-view" wpvdefinitionrelationship="[wpv-post-slug]"]
This only works if the Taxonomy Term slug matches the Definition slug, as mentioned earlier.
Relevant Documentation:
https://toolset.com/documentation/user-guides/views-shortcodes/
https://toolset.com/documentation/user-guides/passing-arguments-to-views/
https://toolset.com/documentation/user-guides/front-page-filters/
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 17 replies, has 3 voices.
Last updated by 6 years, 7 months ago.
Assisted by: Christian Cox.