Problem:
Setup links to parent post, the link text is a custom field value of parent post.
I wrote a shortcode [next-post-id] to get the id of the next post.
function shortcode_next_post_id ($atts) { global $post; $next_post = get_next_post(); if (empty ($next_post)) return 0; return $next_post->ID; } add_shortcode('next-post-id', 'shortcode_next_post_id');
Solution:
Since you have already got the post ID of next post with custom shortcode [next-post-id], so you can setup the link manually with HTML code, for example:
<a href="[wpv-post-url id=[next-post-id]]"> [types field='rs-brandname' id='[next-post-id]'][/types]</a>
Please make sure you have already registered the custom shortcode name in the Toolset setting page:
Dashboard->Toolset-> Front-end content
option "Third-party shortcode arguments", fill the custom shortcode name: next-post-id
Relevant Documentation:
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 |
---|---|---|---|---|---|---|
- | 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/Hong_Kong (GMT+08:00)
This topic contains 3 replies, has 2 voices.
Last updated by 7 years, 2 months ago.
Assisted by: Luo Yang.