• I am currently using the following code in my post without problem, but I want to put the code in a theme and it seems it’s not working. Does any body know is there anything wrong? Thanks.

    [coupon title="<?php echo get_the_title(); ?>" url="<?php the_field('coupon_destination_url'); ?>" code="<?php the_field('coupon_code'); ?>" image="https://123.com/123.jpg" button="some text" description="<?php the_field('coupon_description'); ?>"]

    https://www.ads-software.com/plugins/advanced-custom-fields/

Viewing 2 replies - 1 through 2 (of 2 total)
  • hi, when you say “theme” im assuming you’re referring to theme “template” (eg page.php).

    try putting it inside your template file this way:

    echo do_shortcode('[coupon title="'.get_the_title().'" url="'. the_field('coupon_destination_url').'" code="'.the_field('coupon_code').'" image="https://123.com/123.jpg" button="some text" description="'.the_field('coupon_description').'"]');

    Anonymous User 13176105

    (@anonymized-13176105)

    I’m also keen to find out how to do this; not inside the theme template, but as per the original post, inside the actual content area for a page. Does anyone know if this is possible?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘ACF code inside another shortcode?’ is closed to new replies.