Support Forums for LiveMesh Themes & Plugins › Forums › Agile Theme Support › More Fields in the Theme Contact Form
- This topic has 9 replies, 2 voices, and was last updated 11 years, 1 month ago by
Raghavendra.
-
AuthorPosts
-
February 6, 2014 at 10:30 pm #4232
urbanheather
MemberHi! 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!
February 7, 2014 at 1:24 pm #4257Raghavendra
ModeratorYou 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 .= '';
February 13, 2014 at 11:31 am #4433urbanheather
MemberHi 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
February 13, 2014 at 12:45 pm #4442Raghavendra
ModeratorLooks 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.
February 14, 2014 at 9:36 am #4475urbanheather
MemberHi. 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>’;February 14, 2014 at 1:37 pm #4485Raghavendra
ModeratorI 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.
February 16, 2014 at 2:03 am #4511Raghavendra
ModeratorOk 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>';
February 17, 2014 at 5:02 am #4534Raghavendra
ModeratorThis reply has been marked as private.February 17, 2014 at 9:35 am #4550urbanheather
MemberHi,
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 🙂
February 17, 2014 at 1:33 pm #4567Raghavendra
ModeratorThis reply has been marked as private. -
AuthorPosts
- The topic ‘More Fields in the Theme Contact Form’ is closed to new replies.