Include phone number in Classipress contact form

Adding phone number in your Classipress contact form

We have been asked several times about the option to include as an optional field the phone number in your Classipress site. Unfortunately, the Classipress contact form is a built-in feature and this form cannot be customized from the theme settigns. So, in order to help our clients and the Classipress community, we have just created this small tutorial to allow you to add the phone number field in your Classipress site. The code provided in this tutorial has been tested with Classipress 3.5.7, the last stable version.

The new form will look like this one:

 

phone-number-classipress-contact-form

After the user submission, the phone number info will be included in the email notification:

classipress-email-phone-number

Follow the next steps:

  • If you are not using a child theme, create one following this guide
  • Add this function to your childtheme’s functions.php file (please, remember to take out the php tag’s if your functions.php file already has code):

  • Create a new folder (if it does not exists yet) in your childtheme named ‘includes’
  • Create a new file in your childtheme’s includes folder named ‘sidebar-contact.php’
  • Copy & Paste the following code in your new childtheme file sidebar-contact.php:

 

  • That’s all.  Enjoy it! ;)