Skip Navigation

[Resuelto] How can I assign in a view the id of the post inside a shortcode?

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

Problem:

The issue here is that the user wanted to know how to get the current post's ID with a shortcode.

Solution:

This can be done by using the shortcode below.
[wpv-post-id]

This support ticket is created hace 4 años, 3 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.

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 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Etiquetado: 

Este tema contiene 4 respuestas, tiene 2 mensajes.

Última actualización por Francisco Ramón Molina Busquiel hace 4 años, 3 meses.

Asistido por: Shane.

Autor
Mensajes
#1727027

Hi,

Inside a shortcode included in a block of a Toolset view how can I put the id of the current post?
For example, in the following shortcode:
[sdm_download id="4868" fancy="0"]
how can I make the number 4868 the id of the current post?
Something like:
[sdm_download id="{id_post}" fancy="0"]

Thanks for your help.
Regards,
Jose A.

#1727521

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hi Jose,

This will only work if your shortcode accepts a shortcode as a parameter. If it does you can try this.
[sdm_download id="[wpv-post-id]" fancy="0"]

Thanks,
Shane

#1727641

Hi Shane,

It has worked perfectly. 🙂

Have you been able to see the problem of the other ticket I have?
https://toolset.com/forums/topic/i-cant-assign-a-custom-field-to-a-toolset-block-image/

Thanks for your help.

Regards,
Jose A.

#1728579

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hi Jose,

Happy I was able to assist you with this one.

I'm currently having a look at your other ticket so you can mark this one as resolved.

Thanks,
Shane

#1728659

My issue is resolved now. Thank you!