More Fields in the Theme Contact Form

Support Forums for LiveMesh Themes & Plugins Forums Agile Theme Support More Fields in the Theme Contact Form

This topic is: resolved

This topic contains 9 replies, has 2 voices, and was last updated by Raghavendra Raghavendra 5 years, 9 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #4232
    Urbanheather
    urbanheather
    Member
    Post count: 18

    Hi! I was just wondering if it’s possible to add another field in the contact form that came in the theme? I like the way the theme form is presented a lot better than Contact Form 7 so I’d prefer to keep the theme one. I just want to replace the “URL” field for “Company”

    Thanks!

    #4257
    Raghavendra
    Raghavendra
    Moderator
    Post count: 4676

    You can do so by editing the file framework/shortcodes/contact-shortcodes.php file at line number 37. Rename the strings from URL to company and then need to change the type of input from url to text this way –

                $output .= '

    ';
    #4433
    Urbanheather
    urbanheather
    Member
    Post count: 18

    Hi this hasn’t worked.

    I’ve changed line 12 to “‘company_name’ => true,” and I’ve also changed line 36/37 to:

    if (mo_to_boolean($company_name))
    $output .= ‘<p><label>’ . __(‘Company’, ‘mo_theme’) . ‘</label><input type=”text” name=”company_contact” placeholder=”‘ . __(“Company:”, ‘mo_theme’) . ‘” class=”text-input”></p>’;

    I have cleared my cache but this has still not worked?

    Thanks

    http://www.yumbelievable.co.uk

    #4442
    Raghavendra
    Raghavendra
    Moderator
    Post count: 4676

    Looks like your code was changed a little more than needed. To make this work, you should make the change exactly as provided above. So, pls ensure you do not modify the if condition (if (mo_to_boolean($company_name) – retain the original code here) and also ensure that name=”contact_url” is retained so that the framework/scripts/sendmail.php script processes the value entered. Hope this resolves the issue.

    #4475
    Urbanheather
    urbanheather
    Member
    Post count: 18

    Hi. I kept the original code so that’s no problem. I amended the code and only edited exactly as you have said and still there is no change to my website. This is extremely frustrating 🙁

    if (mo_to_boolean($web_url))
    $output .= ‘<p><label>’ . __(‘Company’, ‘mo_theme’) . ‘</label><input type=”text” name=”contact_url” placeholder=”‘ . __(“Company:”, ‘mo_theme’) . ‘” class=”text-input”/></p>’;

    http://www.yumbelievable.co.uk/

    #4485
    Raghavendra
    Raghavendra
    Moderator
    Post count: 4676

    I can make the change if you send me temp FTP login details (pls post here as a private message). Changing PHP from the WordPress console is risky and bring down the site quickly with slightest error. I have tested the code in my server and things look fine. Probably there is something small missing here. Will take care of it.

    #4511
    Raghavendra
    Raghavendra
    Moderator
    Post count: 4676

    Ok my mistake. I had an example contact-shortcodes.php file in the child theme which had to be modified. Good thing is that you do not have to modify the core theme files and keep the customization in the child theme so that the change is not lost. Pls have a look and things look ok pls let me know. I had to make one additional change to the above to block URL validation by Javascript – had to change the name to contact_company from contact_url –

            if (mo_to_boolean($web_url))
    			$output .= '<p><label>' . __('Company', 'mo_theme') . '</label><input type="text" name="contact_company" placeholder="' . __("Company:", 'mo_theme') . '" class="text-input"/></p>';
    
    #4534
    Raghavendra
    Raghavendra
    Moderator
    Post count: 4676
    This reply has been marked as private.
    #4550
    Urbanheather
    urbanheather
    Member
    Post count: 18

    Hi,

    I’ve just checked the contact form and done a test message and it looks great and works fine. Thanks so much for all your help.

    Brill theme and 10/10 support 🙂

    #4567
    Raghavendra
    Raghavendra
    Moderator
    Post count: 4676
    This reply has been marked as private.
Viewing 10 posts - 1 through 10 (of 10 total)

The topic ‘More Fields in the Theme Contact Form’ is closed to new replies.