All of our Premium WordPress Themes come with a built-in Contact Form included in a separate page template.
You can easily add the contact form you an existing page:
- Create new or open an existing page
- Right Column -> Page Attributes -> Template -> Select ‘Contact Page’
- Cick on ‘Publish’ (or ‘Update’) button to save the changes
- Now when you open the Page, the contact form will be displayed:
Note: When the contact form is filled and submitted, it will send an email to the Admin Email (which is set to Admin Panel -> Left Menu -> Settings -> General -> Email Address).
You can customize the Google Map and the Right Sidebar:
- Navigate to Admin Panel -> Left Menu -> Appearance -> Customize
- Open ‘Contact Page’ section
- Update fields for Google Map and Right Content Area
You can also add a CAPTCHA to your Contact Form:
- Download the Really Simple CAPTCHA PluginSource: https://wordpress.org/plugins/really-simple-captcha/
- Upload the plugin to Your WordPress site (Admin Panel -> Left Menu -> Plugins -> Add New)
- Install and Activate the plugin.
How to Change the Email Subject in Your Contact Page Template
If you want to customize the subject line of the emails you receive from your website’s contact form, you can easily do so by editing the contact page template directly from your WordPress Admin Panel. This guide will walk you through the simple steps to set a hardcoded email subject.
1. Access the Theme Editor
- Log in to your WordPress Admin Panel.
- Navigate to the Left Menu and click on Appearance.
- From the dropdown menu, select Theme Editor.Note:
2. Locate the page-contact.php
Template File
- On the right side of the Theme Editor, you’ll see a list of theme files.
- Scroll down to find the
page-templates/page-contact.php
file. - Click on
page-contact.php
to open it in the editor.
3. Find the Email Sending Code
- In the editor, scroll down to locate the line of code that sends the email. You’re looking for a line that contains
wp_mail
. - The code should look like this:
wp_mail( $emailTo, __( '[Contact Form] ', 'tishonator' ).$subject, $body, $headers );
This line sends the email with the subject line that includes[Contact Form]
and the subject entered by the user.
4. Modify the Email Subject to a Hardcoded Value
- To set a fixed subject line for all emails from the contact form, replace the existing
wp_mail
line with the following code:wp_mail( $emailTo, 'New Contact Form Message', $body, $headers );
Replace'New Contact Form Message'
with the exact subject line you want to use.
Example:wp_mail( $emailTo, 'Website Inquiry', $body, $headers );
That’s it. Then simply save changes you made to the file.
Additional Tips & Tricks
How to Change ‘project’ Slug Name
We include Projects as a custom post type in many of our WordPress themes. It is a useful custom type of data which allows you to organize your website content and display it as a block and single projects page.
In some cases you may want to rename the ‘projects’ slug (the part ‘projects’ in single projects URL i.e. https://yoursite.com/projects/some-project-name/) it to another word. It will require some code changes. Here are all of the necessary steps:
1.Login to your Admin Panel
2. Navigate to Left Menu -> Appearance -> Theme Editor
3. Open functions.php
4. Rename the following occurrences of ‘project’ to ‘your_new_name’:
register_post_type( 'project', $args );
$data = get_post_meta($post->ID, 'project', true);
if ( 'project' != get_post_type( $post_id ) )
update_post_meta( $post_id, 'project', $data );
add_meta_box( 'project_metabox', 'Class Information', 'tishonator_add_class_fields', 'class' );
if ($post_type == 'project') {
5. The same rename of ‘class’ needs to be applied in file inc/blocks.php
$projectsArgs = array( 'post_type' => 'project', 'posts_per_page' => $count);
$data = get_post_meta( $r->post->ID, 'project', true );
6. And the same rename of ‘project’ needs to be applied in file single-project.php
$data = get_post_meta( get_the_ID(), 'class', true );
8. Also, you need to connect via FTP to your site /public_html/yoursite/wp-content/themes/yourtheme and rename file: single-project.php to your single-yournewname.php
Please Note: After the above change, all of the existing Projects in Admin Panel -> Left Menu -> Projects will disappear and they needs to be recreated again.