Property custom post type provides various fields by default like price, beds, baths etc. Since version 3.0.2, New fields can be added and displayed using child theme.
You can add a new field by pasting following code in child theme’s function.php file. It’s not recommended to modify parent theme as it will restrict you from updating it in future.
We are creating a new list of fields in a new property MetaBox tab.
1) The first element of the array is called tab. And it contains information about the new custom tab.
2) The second element of the array is called fields. It is an array of arrays, in which each array is containing information of a property custom meta field.
The above-given code will create a custom tab with two custom meta fields in Property MetaBox as you can see in the following image.
These custom fields values will be automatically displayed in the property meta info bar on the property detail page.
How to add these custom meta fields to property submit page
Depending on the design you are using you must edit two files to add any new fields to property submit page. The files are located in the following directories for both designs.
wp-content – themes – realhomes – assets – classic – partials – property – submit-form.php
wp-content – themes – realhomes – assets – classic – partials – page – submit-property.php
wp-content – themes – realhomes – assets – modern – partials – property – submit-form.php
wp-content – themes – realhomes – assets – modern – partials – page – submit-property.php
The file submit-form.php contains the code of input field displayed in the Submit Property Form and the other file which is submit-property.php contains the code which processes the data submitted by the user. So, you must add the code for new fields in both of these files.