Shortcodes in excerpt

Forums › Forums › General › Shortcodes in excerpt

Tagged: 

Viewing 10 posts – 11 through 20 (of 20 total)
  • Anonymous
    #205982

    Is the page loading using Ajax? If so, that will be the issue, as the player you are using needs reinitialising after an Ajax load. What player are you using?

    I am using Ajax to load the page. I am using standard WP audio shortcode.
    I turned Ajax off and all is good now. Thanks!

    <?php if( get_field(‘my_custom_field’) ):?>
    <p>My Custom Field Value: <?php the_field(‘my_custom_field’); ?></p>
    <?php endif; ?>

    thanks, I will try

    PS Very good support speed!

    Anonymous
    #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=17Y89ciQhBGyEegIogWIVu8UgCDow67Ao

    How to solve it?

    Trevor
    #206079

    Did 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.

    Anonymous
    #206083

    It doesn’t work ((

    I am not very savvy in php. But I need this button to display.

    Trevor
    #206085
    This reply has been marked as private.
    Anonymous
    #206099
    This reply has been marked as private.
    Trevor
    #206101
    This reply has been marked as private.
    Anonymous
    #206103
    This reply has been marked as private.
    Trevor
    #206182

    I changed the code to this:

    <?php if( get_field('purchase') ):?>
    <p><?php echo do_shortcode(get_field('purchase')); ?></p>
    <?php endif; ?>
    Anonymous
    #206192

    Thanks! All is working as intended. Thanks for the support.

    Waiting for a new version with default taxonomy value. =)

Viewing 10 posts – 11 through 20 (of 20 total)

Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.