How can I replace the default Contact form with a Contact plugin?

edited November 2014 in HealthCentre
I need to have a contact form with additional fields. Is there way to replace the contact form (only the form) on the Contact Us page with a form developed by a contact plugin such as Contact Form 7 or Gravity Forms?

(again, I want to keep the Contact Us template but just substitute a different form for the default form)



  • Hi

    Its better to use default or full width template if you are planning to add contact form 7 forms and style your forms accordingly.

    But, If you want to use  theme's contact us template, although we are not sure about the responsiveness either , than refer this link

    Kindly refer the plugin docs.

    For styling it as similar to the theme you have to specify theme specific classes  to the input fields

    for example if you want to style input field similar to theme's contact form, than, assign class as "hc_con_input_control

    How to connect the form with the template?

    edit the contact-us.php file and remove the form code ie all the code snippet b/n 

    <div class="col-md-8 hc_contactv1_area">

    Now embed your form in the above wrapper and refer this link further

    If you are not comfortable with this than you need to higher a developer for this.

    Hope I made my point clear.

  • Thanks Imran I will look into this.
    For now as immediate change using your Contact Us theme, I need to change the field "Website" to phone. How do I do that?
    Also I am not clear what will be the subject of the email, what email address is used for "From", what is the subject of the email and where do I edit that, what is the confirmation/thank-you message and where do I edit that?

  • edited November 2014
    For editing thank you message edit the snippet of contact-us.php file

    <div id="mailsentbox" style="display:none">
    <div class="alert alert-success" >
    <strong><?php _e('Thank you!','health');?></strong> <?php _e('You successfully sent contact information...','health');?>

    Add your message as per your requirements.

    For changing website field to phone edit the below snippet in the above file

    <div class="hc_form_group">
    <label for="user_website"><?php _e('Website','health'); ?></label>
    <input type="text" id="user_website" name= "user_website" class="hc_con_input_control">

    and rename the label value to Phone insplace of Website.

    Edit subject of email 

    Find this line of code $subject = "MAIL FROM YOUR WORDPRESS BLOG SITE"; and add your subject description instead.

    Now last and most important thing you will receive this email on your admin email. But inorder to work with this form you have install easy smtp mail plugin.
    Let me know for any confusions

  • priyanshu, I modified the contact-us.php per your instructions and replaced "user_website" with "user_phone" yet this field (the phone number) does not come with all the form data in the email received.
  • Dont change user_website just change the label value ie

    <label for="user_website"><?php _e('Website','health'); ?></label>


    <label for="user_website"><?php _e('Phone','health'); ?></label>
  • priyanshu, followed your instructions again and the problem remain. Everything I put it the Website field no matter what the label is does not come in the email message. Here is the email message received you can see that there is no phone # in the message:

    From: Michael Cohn [mailto:[email protected]]
    Sent: Friday, November 14, 2014 1:44 PM
    To: Daniel Pessar
    Subject: Contact Form Data from

    Again this is a test message from new website under development. if you received this email please forward it to me at [email protected]

    Thank you,

  • Find this snippet 

    $massage = stripslashes(trim($_POST['user_comment']))."Message sent from:: ".trim($_POST['user_email']);

    and replace it with 

    $massage = stripslashes(trim($_POST['user_comment']))."Message sent from:: ".trim($_POST['user_email']);
    $massage.="  User Phone Number::  ".trim($_POST['user_website']);

  • this code now is totally broken. email is not sent.
    are you sure it is $massage.="... with the .=?
This discussion has been closed.