Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi

    Per this discussion
    https://www.ads-software.com/support/topic/contact-form-7-php-invocation-code?replies=17

    try adding this PHP code beneath the post code in your theme’s template file:
    <?php echo do_shortcode("[contact-form 1 'Contact form 1']"); ?>

    You have to substitute the form name that the plugin assigned to the form in question if it is not contact form 1.

    (I haven’t tried this, just copied it for you from the discussion).

    Thread Starter webnetimages

    (@webnetimages)

    Thanks for thr reply, it′s work for me adding these sentence;

    if ( is_singular() ) {
    the_content(); // display content on posts/pages
    echo do_shortcode( ‘[contact-form 1 "Formulario de contacto 1"]‘ );
    }

    But allso insert the contact-form on the pages, I only need it on post.
    Any ideas?
    Thanks.

    Try this. It will only display the contact form on single post pages. Is that what you want?

    if ( is_singular() ) {
       the_content(); // display content on posts/pages
       if ( is_single() ) {
          echo do_shortcode( '[contact-form 1 "Formulario de contacto 1"]' );
       }
    }
    Thread Starter webnetimages

    (@webnetimages)

    Great, Works!!
    learning a bit each time.
    Thanks!!!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Contact Form 7] how to add the same form in all post?’ is closed to new replies.