• Resolved Florian

    (@pictibe)


    Hi,

    love this plugin but today i have a little problem.
    I want to insert a contact form in the snippet but it doesn’t work.

    My snippet has an easy return with some divs and i want to load the cf7.
    I test it to save in a variable but it won’t work:

    $form = do_shortcode( '[contact-form-7 id="739"]' );

    and in return

    <div class="wpb_wrapper">'.$form.'</div>

    Can you please help me?

Viewing 1 replies (of 1 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    I tried this snippet to test, and it seems to work as expected:

    add_filter( 'the_content', function ( $content ) {
      $form = do_shortcode( '[contact-form-7 id="137" title="Contact form 1"]' );
      return '<div class="wpb_wrapper">' . $form . '</div>' . $content;
    } );

    What is the full code you are using for your snippet?

Viewing 1 replies (of 1 total)
  • The topic ‘do_shortcode in Snippet’ is closed to new replies.