Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1468709

    Hello team, I would like to integrate a form on all portfolio pages as the last element in the content (not via hook after the content – before the footer). I tried this with the recommended shortcut from Contact Form 7 and put it directly into the corresponding template of Enfold:
    <?php echo apply_shortcodes( ‘[contact-form-7 id=“1234” title=“Contact form 1”]’ ); ?>
    Unfortunately, the shortcode is not executed, why is that?

    Many thanks and best regards

    #1468710

    try

    <?php echo do_shortcode( '[contact-form-7 id="1234" title="Contact form 1"]' ); ?>
    

    and what template do you use? single-portfolio.php

    maybe to get it on both ( classic styled portfolios and advanced layout builded portfolios) it will be better to hook into footer.php for only portfolios.

    try instead in your child-theme functions.php:

    add_action('ava_before_footer', function() {
      if (is_singular( 'portfolio' )){
        echo '<div class="container">';
        echo do_shortcode( '[contact-form-7 id="1234" title="Contact form 1"]' );
        echo '</div>';
      }
    });
    #1468795

    Hi Guenni007,

    thank you, works well :)

    Best Regards
    Mike

    #1468825

    Hi,

    Thanks for the update, we’ll close this thread for now then. Please open a new thread if you should have any further questions or problems.

    Thanks @guenni007 for helping out :-)

    Best regards,
    Rikard

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Contact Form 7 Shortcode in Template’ is closed to new replies.