• Resolved Andrew

    (@cipes)


    I’m pretty impressed at how hard it is to get the constant contact form to be output into a template.

    I’d like to output an email list sign up form into my footer.php. and the classic do_shortcode('[ctct form="869" show_title="false"]'); wordpress function does not execute the constant contact shortcode.

    How do I return the form into a template?

    I’ve looked the function here constant_contact_display_form( $formID ); which is referenced here but that is not working either.

    How can you have a plugin that uses says it uses a ‘Shortcode’. when it actually doesnt (else WP do_shortcode() should execute it) AND NOT provide documentation on how to output the form into a template??

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Constant Contact

    (@constantcontact)

    Hi Andrew,

    For the do_shortcode() version, above, you’d need to echo it.

    echo do_shortcode('[ctct form="869" show_title="false"]');
    

    Not quite sure what may be going on for the constant_contact_display_form() version above, but I also don’t know what is in $formID in this case. However, i do know that that function trickles down into a get_form() function in our plugin, and it returns empty string if we don’t have a valid integer for the ID, or there’s no post meta for the form. It’s also possible that some of the output is being generated, but perhaps not all of it. This one should be self-echo’ing, so no need to do echo constant_contact_display_form( $formID );

    Plugin Author Constant Contact

    (@constantcontact)

    Did you get this figured out @cipes ?

    Thread Starter Andrew

    (@cipes)

    I had to echo the do_shortcode[]. My fault! Thank you for that.

    Plugin Author Constant Contact

    (@constantcontact)

    Awesome to hear that things are working now. Hopefully getting plenty of signups as well.

    Let us know if you need anything else.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Using Forms in a template’ is closed to new replies.