Tagged: V3
- This topic has 19 replies, 2 voices, and was last updated 6 years, 5 months ago by
Anonymous.
-
Anonymous(Private) March 23, 2019 at 5:52 am #206075
As to ACF fields. Let us assume it is a single value field use key is my_custom_field and the prefix required is My Custom Field Value, then the PHP is this:
I did it and it works. But again, there is a shortcode (button) in this field and it’s not working. Just showing me shortcode texts:
https://drive.google.com/open?id=17Y89ciQhBGyEegIogWIVu8UgCDow67AoHow to solve it?
Trevor(Private) March 23, 2019 at 6:57 am #206079Did you try wrapping that code in a do_shortcode function?
<?php if( get_field('my_custom_field') ):?> <p>My Custom Field Value: <?php do_shortcode(the_field('my_custom_field')); ?></p> <?php endif; ?>
I am not sure if that would work. Otherwise you may need to use PHP string functions to fetch the string as before, then split it up into before the button shortcode, the shortcode and the what comes after, and then handle them, with the shortcode being output in a do_shortcode function.
-
AuthorPosts