views:

32

answers:

2

Hi,

I want to build my WP theme with a built in contact form. Something simple without captcha. I would like to use just Akismet as a spam filter. So, my first thought was to "convert" the comments.php page into a contact page template. Which I got it, but some points need to be improve.

1) When you use the contact, there is no notification if the content was sent it or not. How could I put a "Thank You" message for the user?

2) As you know, with this approach the contact info doesn't go to my email. Instead it's appear in the comments admin page. Is there any chance to make WP really send me the contact info to my email?

As I said before, I don't want to use a plugin, so if you have any idea how to help me to solve these issues or a new approach to this, it will be highly appreciated.

+1  A: 

You should simply use php mail function with your form data. If you don't wont to use plugin, you should still look at some simple plugin for code examples.

There are a lot of free open source themes with contat form you can also use as example. You should also consider creating a wordpress child theme for the theme that already has contact form. That is clean and simple solution.

aco
A: 

Why not use a plug-in? WHY "don't you want" to?!

It can turn 1 hour of programming to 5 minutes.

Your best bet is to edit the comment-template form so it doesn't display the comments in each page or post such as single.php, index.php, page.php

Let the form only display.

When you do that, you can go into your Settings -> "Discussion Settings"

  • E-mail me whenever Anyone posts a comment

Checkbox the above options. And you should be good to go.

Anraiki