I recently added a contact page to my blog using the WordPress Contact Form plugin. It’s much easier to install than the other contact forms I found, but if you want it to look it’s best you have to take a few extra steps. Douglas doesn’t walk you through them on his blog, so I’ve posted them here for new bloggers (or bloggers who have just never had to make a page template before).
The first few steps are the usual ones - copy the “wp-contact-form” folder into your plugin folder, and enable the plugin. Then go to Settings > Contact Form and fill in your info. Now there are two ways to proceed: you can either make a new page and insert %%wpcontactform%% into the content area, or you can build a page template and assign it to your contact page. The first method is the easiest, but unfortunately your contact form will look like this:
The second method takes a little more work, but the results are much better:
To get the second result, you will first need to make a page template. To do this, just copy your existing page.php file and paste the following code in the beginning:
<?php /*
Template Name: Contact Page
*/ ?>
Now paste the code <?php wpcontactform() ?> above the div containing your post content - this is so that if you have any plugins that insert something at the bottom of your posts (ShareThis, etc.), they will appear below your contact form instead of above it. The div will probably be called <div class="post-content">, <div class="entry-content">, or something similar. Now save your page with another name (for example “contact.php”), and upload it into your current theme’s folder. The last step is to just create a new page, scroll down to the Advanced Options, click on Page Template, and choose your contact page template from the dropdown box.
| 2.5 |
If you enjoyed this post, make sure you subscribe to my RSS feed!
Silla