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 the following code to add a contact form to my template, but this code as is breaks the page. It just shows a white page when I add this code. Am I doing it wrong.

<?php
[contact-form-7 id="181" title="Contact form 1"]
?>
share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

Well without more code it's hard to tell but one thing is you are wrapping a shortcode with php tags. My guess is you have error logs turned off or you'd see Santax error unexpected '[' on line XXX

If you are using the post/page editor you want to use[contact-form-7 id="181" title="Contact form 1"] (see no php tags)

If you really want to use php tags (or embed the form into a template) you could do something like

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

If that doesn't help please post more code.

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.