I have been able to get the contact form to show up in a page but when I put the same code in a post it just renders the tag instead of the form. Anyone know why? Thanks.
I have been able to get the contact form to show up in a page but when I put the same code in a post it just renders the tag instead of the form. Anyone know why? Thanks.
I just created a page that uses a template other than the default. In this case the form does not show up. The page that does use the default template does display the form. So, now I'm thinking it's not a page vs. post issue but the default template vs. a custom one. Any ideas?
Does your custom template have <?php the_content(); ?> inside it? The default one should have.
Try reviewing Creating_Your_Own_Page_Templates.
Not initially. I had echo $post->post_content. However, if I use <?php the_content(); ?> or <?php $post->post_content; ?> it just displays nothing.
I'm new to wordpress and all of this, so here's my template. Anyone see a problem with it that would cause this?
[Code moderated as per the Forum Rules. Please use the pastebin]
Never use $post->post_content. Use the_content() instead.
Okay, but even with the_content(), I'm not getting anything. I've even put in some text before the form to see if I get that and no, I don't get that either.
Woops, sorry bout the code & forum rules violation. Here's the pastebin version - http://pastebin.com/1n8qxWtr
You can't add in your own input fields as part of a CF7 form!
What input fields have I added? For the page content I have the following...
test
[contact-form-7 id="99" title="Contact form 1"]
What's wrong with that?
Sorry - I misread your contact details (tabled layout *shudder*). That template file does not contain a Loop. No Loop - no page content.
Even with a loop, I'm still not getting the content.
<div id="dvContactRight">
<div class="contacttitle">Send a Message</div>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); endwhile; endif;?>
</div>
Full code here - http://pastebin.com/7DmhgZFn
No - go and read The_Loop and Creating_Your_Own_Page_Templates again. Carefully, this time.
So apparently I missed the_content() in the loop. For anyone else having an issue, this code works.
<div id="dvContactRight">
<div class="contacttitle">Send a Message</div>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); the_content(); endwhile; endif;?>
</div>You must log in to post.