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.
Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.
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)
Este tema contiene 3 respuestas, tiene 2 mensajes.
Última actualización por hace 7 años, 2 meses.
Asistido por: Luo Yang.