Saltar navegación

[Resuelto] Struggling to link to Parent post/page

This support ticket is created hace 3 años, 10 meses. 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/Hong_Kong (GMT+08:00)

Este tema contiene 1 respuesta, tiene 2 mensajes.

Última actualización por Luo Yang hace 3 años, 10 meses.

Asistido por: Luo Yang.

Autor
Mensajes
#2097311

Tell us what you are trying to do? Link a post within a loop to its parent page/post instead of itself

Is there any documentation that you are following? NO (I tried several with no luck)

Is there a similar example that we can see? I can provide in a private message

What is the link to your site? I can provide in a private message

On my site I have a page that lists a series of upcoming workshops within a view.
Each item in the loop has a link to its main details page.
For items in the loop that have parents (in my case, post types that are not "workshop") I prefer to link to their parent page instead, but I can't get it to work (although some code used to work in the past.)

I have tried:

[wpv-conditional if="( '[wpv-post-type]' ne 'workshop' )"]More Details[/wpv-conditional]

and:

[wpv-conditional if="( '[wpv-post-type]' ne 'workshop' )"]More Details[/wpv-conditional]

But neither seem to work. I'd be very grateful if anyone can help me solve this issue.

#2097617

Hello,

It seems that the custom post type "workshop" is using slug "workshops", please try to change your shortcodes as below and test again:

[wpv-conditional if="( '[wpv-post-type]' ne 'workshops' )"]<a href="[wpv-post-url item='@workshops-series-events.parent']">More Details</a>[/wpv-conditional]