I am using contact form 7. It says to use the following

[contact-form-7 id="23" title="Contact form 1"]

In my post or page, I have placed it in my post. Now I am using this code to grab the post a spit it out on my custom-page.php file. However it just spits out the title of the page the date, and the content "posted in" No form to be seen. Also what's the best way to put a contact form on a page and be able to move it around with css and such with contact form 7.

 <!-- Start the Loop. -->
 <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

 <!-- Display the Title as a link to the Post's permalink. -->
 <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>

 <!-- Display the date (November 16th, 2009 format) and a link to other posts by this posts author. -->
 <small><?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?></small>

 <!-- Display the Post's Content in a div box. -->
 <div class="entry">
   <?php the_content(); ?>

 <!-- Stop The Loop (but note the "else:" - see next line). -->
 <?php endwhile; else: ?>

 <!-- The very first "if" tested to see if there were any Posts to -->
 <!-- display.  This "else" part tells what do if there weren't any. -->
 <p>Sorry, no posts matched your criteria.</p>

 <!-- REALLY stop The Loop. -->
 <?php endif; ?>
  • did u try adding a clear between small and entry? – andresmijares Jan 25 '12 at 23:32

You could always do something like this:

echo do_shortcode( '[contact-form-7 id="23" title="Contact form 1"]' );

And put that anywhere in your theme to display it.

Docs: do_shortcode

|improve this answer|||||

Not the answer you're looking for? Browse other questions tagged or ask your own question.