Hi,
Is there a way to add some dynamic elements in the Prev/Next Page shortcode? (the one in the Content Template of the CPT, not in the view)
Thx
Hello,
There isn't such kind of built-in feature within Toolset plugins, but you can try the workaround in similar thread here:
https://toolset.com/forums/topic/displaying-featured-image-of-previous-and-next-post-on-single-post-page/
Hi Luo Yang,
Thank you for your help.
Unfortunately, I can't get it to work, looks like a " or ' conflict, but I can't find the appropriate work around.
You can see it there: hidden link
(I tried it on another site, with no more luck)
Regards
Since it is a custom codes problem, please provide your website credentials in below private message box, also point out where I can edit your PHP codes, I need to test and debug it in a live website, thanks
Hi,
Thank you for sharing the admin access.
Luo will be on vacation this week, so I'll follow up on this ticket.
I added the custom shortcode "ts_get_adjacent_post_id" in the "Third-party shortcode arguments" section, at WP Admin -> Toolset -> Settings -> Front-end Content and removed the comments from the content template and the featured image is showing now.
( example screenshot: hidden link )
regards,
Waqar
Hi Waqar,
Haw yes, registering the shortcode. This is something I was not aware of.
Maybe you could give another hand about this: I want the featured image to link to the post. I tried many combinations of [wpv-post-previous-link format="%%LINK%%"], for example [wpv-post-previous-link format="[wpv-post-featured-image item="[ts_get_adjacent_post_id previous='true']"] %%LINK%%"] but I can't make it to work.
Many many thx for your help, truly appreciated!
Regards
Thanks for the update and glad that it works.
To link the featured images to their respective posts, you can use the "wpv-post-url" shortcode with the item attribute:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-post-url
Example:
// previous post link
<a href="[wpv-post-url item='[ts_get_adjacent_post_id previous='true']']">
[wpv-post-featured-image size="custom" width="100" height="100" crop="true" item="[ts_get_adjacent_post_id previous='true']"]
</a>
// next post link
<a href="[wpv-post-url item='[ts_get_adjacent_post_id]']">
[wpv-post-featured-image size="custom" width="100" height="100" crop="true" item="[ts_get_adjacent_post_id]"]
</a>
Works perfectly. Amazing support, many thx!