Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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(); ?>
 </div>

 <!-- 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; ?>
share|improve this question
    
did u try adding a clear between small and entry? –  andresmijares25 Jan 25 '12 at 23:32
add comment

1 Answer

up vote 1 down vote accepted

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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