I have a shordcode for Contact Form 7 form. I want use Advanced Custom Fields for ID value. How Can I do that?
the ACF with ID value:
<?php echo do_shortcode( '[contact-form-7 id="29"]' ); ?>
Any solution? :)
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.Sign up to join this community
Simple as this:
<?php echo do_shortcode( '[contact-form-7 id="'.get_field('form').'"]' ); ?>
You have to notice, you should use
get_field() to return the value.
the_field() will echo it.