• Resolved Patrick

    (@randomgift)


    For the special mail tags fetching [_post_*] data to work they must be inside the post / page’s content.

    However, my form is in the template files. Is there any way to use the [_post_*] when the form is outside of the the_content ?

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Patrick

    (@randomgift)

    I use my form inside an if statement, so I placed it before the endwhile; ?>` and it works fine – but the [_post_title] mail tag still doesn’t work.

    Any idea why?

    This is ewhat I have:

    <?php
    						if ( have_posts() ) while ( have_posts() ) : the_post();
    							echo'<h3><a href="' . get_permalink() . '" rel="bookmark">'.get_the_title($post->ID).'</a></h3>' ;
    
    							echo the_content();
    						endwhile; 
    
    						if( in_category('special-offers') ) : ?>
    <p>Apply for this offer by filling out the simple enquiry form below and we will be in touch shortly.</p><!-- this is a html section -->
    <?php echo do_shortcode( '[contact-form 3 "Spcial Offers"]' ); ?>
    <?php else :
    /*php for other*/
    endif;
    						?>

    Thanks again!

    You placed <?php echo do_shortcode( '[contact-form 3 "Spcial Offers"]' ); ?> after the endwhile ?

    Thread Starter Patrick

    (@randomgift)

    Sorry forgot to update!

    Worked a treat, thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Contact Form 7 – Special Tags inside the template’ is closed to new replies.