How to create different success messages for each Contact Form

By default, the Theme’s Contact Form allows you to setup a Success Message for the Contact Form via the Site Options panel. If you have multiple Forms and wish to have a different Success Message for each Form, please follow the instructions bellow:

Karma Theme:

Access your server via FTP Locate the grunion-contact-form.php file in wp-content/themes/Karma/truethemes_framework/extended/grunion-contact-form/ Open the file and scroll down to the following lines: – line 255, find the following code:

 extract( shortcode_atts( array( 'to' => $default_to, 'subject' => $default_subject, 'show_subject' => 'no', // only used in back-compat mode 'widget' => 0 //This is not exposed to the user. Works with contact_form_widget_atts ), $atts ) ); 

and replace with the following new code.

 extract( shortcode_atts( array( 'to' => $default_to, 'subject' => $default_subject, 'show_subject' => 'no', // only used in back-compat mode 'widget' => 0, //This is not exposed to the user. Works with contact_form_widget_atts 'message' => '' ), $atts ) ); 

Then go to around line 452 and find the following codes:

$contact_successmsg = get_option('ka_contact_successmsg');

…and replace with the following codes:

if(!empty($message)): $contact_successmsg = $message; else: $contact_successmsg = get_option('ka_contact_successmsg'); endif;
* * Usage in Page Editor * *

After you insert the contact form, for example, the following shortcodes.

[raw][contact-form subject="This is subject" to=""] [contact-field label="Name" type="name" required="true" /] [contact-field label="Email" type="email" required="true" /] [contact-field label="Website" type="url" /] [contact-field label="Comment" type="textarea" required="true" /] [/contact-form][/raw]

In the contact-form shortcode, add in message=”custom success message” So now it looks like this.

[raw][contact-form subject="This is subject" to="" message="custom success message"] [contact-field label="Name" type="name" required="true" /] [contact-field label="Email" type="email" required="true" /] [contact-field label="Website" type="url" /] [contact-field label="Comment" type="textarea" required="true" /] [/contact-form][/raw]

Publish. And test out form. Now you will have a custom success message when the form is successfully posted. and because it is a shortcode variable, you can have a custom message per form.


Sterling Theme:

Access your server via FTP Locate the grunion-contact-form.php file in wp-content/themes/Sterling/framework/extended/grunion-contact-form/ Open the file and scroll down to the following lines: – line 254, find the following code:

 extract( shortcode_atts( array( 'to' => $default_to, 'subject' => $default_subject, 'show_subject' => 'no', // only used in back-compat mode 'widget' => 0 //This is not exposed to the user. Works with contact_form_widget_atts ), $atts ) ); 

and replace with the following new code.

 extract( shortcode_atts( array( 'to' => $default_to, 'subject' => $default_subject, 'show_subject' => 'no', // only used in back-compat mode 'widget' => 0, //This is not exposed to the user. Works with contact_form_widget_atts 'message' => '' ), $atts ) ); 

Then go to around line 451 and find the following codes:

$contact_successmsg = get_option('ka_contact_successmsg');

…and replace with the following codes:

if(!empty($message)): $contact_successmsg = $message; else: $contact_successmsg = get_option('ka_contact_successmsg'); endif;
* * Usage in Page Editor * *

After you insert the contact form, for example, the following shortcodes.

[raw][contact-form subject="This is subject" to=""] [contact-field label="Name" type="name" required="true" /] [contact-field label="Email" type="email" required="true" /] [contact-field label="Website" type="url" /] [contact-field label="Comment" type="textarea" required="true" /] [/contact-form][/raw]

In the contact-form shortcode, add in message=”custom success message” So now it looks like this.

[raw][contact-form subject="This is subject" to="" message="custom success message"] [contact-field label="Name" type="name" required="true" /] [contact-field label="Email" type="email" required="true" /] [contact-field label="Website" type="url" /] [contact-field label="Comment" type="textarea" required="true" /] [/contact-form][/raw]

Publish. And test out form. Now you will have a custom success message when the form is successfully posted. and because it is a shortcode variable, you can have a custom message per form. [search_terms]custom, customize, success, message, contact, form[/search_terms]