Problem: I would like to display the title of a parent post in The Grid.
Solution: The standard post relationship shortcodes do not work well in The Grid. Try this custom shortcode instead:
add_shortcode( 'ts-get-parent-artist', 'ts_get_parent_artist_func'); function ts_get_parent_artist_func( $atts, $content ) { $a = shortcode_atts( array( 'child' => '0', 'type' => 'artist', ), $atts ); $parent = toolset_get_related_post( $a['child'], 'artist-release' ); return get_the_title($parent); }
Then add this to The Grid:
[ts-get-parent-artist child="#post_ID#"]
Relevant Documentation:
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_get_related_post
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 16 replies, has 2 voices.
Last updated by 6 years ago.
Assisted by: Christian Cox.