Skip Navigation

[Resolved] Prev/Next pages using Featured image

This support ticket is created 3 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

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
- 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/Karachi (GMT+05:00)

This topic contains 7 replies, has 3 voices.

Last updated by pierre-yvesC 3 years, 4 months ago.

Assisted by: Waqar.

Author
Posts
#2108665
Capture-d’écran,-le-2021-07-07-à-15.14.28.jpg

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

#2108875

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/

#2109457
Capture d’écran, le 2021-07-08 à 13.03.07.png

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

#2109783

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

#2113379

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

#2113479

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

#2114001

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>

#2114271

Works perfectly. Amazing support, many thx!