Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP

How to create custom (HTML) contact forms and set them up for PHP submission in a Wordpress custom theme

Hi there,

I would like to know how to make pretty, self-designed contact forms to place in a Wordpress site (without using an off-the-shelf plugin).

So...Randy has taught us how to process contact form data using a hand-coded PHP form in the Shirts-4-Mike site. For the HTML form 'action' attribute we just put 'contact.php' to enable the form information to be submitted and a thankyou message to appear on the same page. But in Wordpress, if we have a contact page with the URL of '?page_id=26' - and this string is entered into the 'action' attribute - the form is not submitted correctly for some reason.

I would be grateful if someone could shed light on how to design custom contact forms for Wordpress sites, without relying on plugins such as Contact Form 7, or paid for plugins.

Thanks,

Robert London, UK

2 Answers

James Bray
James Bray
8,466 Points

Would also like to know how to extend this tutorial to be compatible with Wordpress.

J