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

closed as off-topic by kaiser Jul 28 at 14:33

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

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

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