Saltar navegación

[Resuelto] Using a single field multiple times in a wpv-for-each loop?

This support ticket is created 4 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 – 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 -

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

Este tema contiene 1 respuesta, tiene 2 mensajes.

Última actualización por Shane 4 years, 4 months ago.

Asistido por: Shane.

Autor
Mensajes
#2298611
wpv.jpg

I'm trying to create a phone link from phone numbers stored as numbers in a repeatable field.

I'm using the "custom" option in the Display Settings (in the Gutenberg editor, WP v5.9), using the following code:

<div>
[wpv-for-each field="##FIELD_SLUG##"]
enlace oculto
[/wpv-for-each]
</div>

What I'd expect is: enlace oculto

What I get instead is: enlace oculto

Here's a screenshot, with the code edited for visibility:

#2298939

Shane
Colaborador

Idiomas: Inglés (English )

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

Hi Filip,

Thank you for getting in touch.

Based on what I see in your code below. You are adding the shortcode exactly like below which is incorrect. I see that you still have "##FIELD_SLUG##" which needs to be replaced with the actual slug of your custom field as ##FIELD_SLUG## is just a placeholder.

[/php]
<div>
[wpv-for-each field="##FIELD_SLUG##"]
enlace oculto
[/wpv-for-each]
[/php]

So what you should have should be similar to below.

[wpv-for-each field="wpcf-my_slug"]
<em><u>enlace oculto</u></em>
[/wpv-for-each]

Where you will replace my_slug with the slug of your repeatable field.

Thanks,
Shane