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##"]
##FIELD##
[/wpv-for-each]
</div>
What I'd expect is: 12345
What I get instead is: ##FIELD##
Here's a screenshot, with the code edited for visibility:
Shane
Supporter
Languages:
English (English )
Timezone:
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##"]
##FIELD##
[/wpv-for-each]
[/php]
So what you should have should be similar to below.
[wpv-for-each field="wpcf-my_slug"]
<a href="tel:[types field='my_slug' output='raw'][/types]"> [types field='my_slug' output='raw'][/types]</a>
[/wpv-for-each]
Where you will replace my_slug with the slug of your repeatable field.
Thanks,
Shane