How to Add a Custom Field to Custom Post Type
Custom fields can be added to any CPT in GeoDirectory to display additional information. This article explains the process of adding custom fields to CPTs.
Adding Custom Fields to CPT
- 1
- Navigate CPT > Settings > Custom Fields.
- 2
- The interface is divided in two panels -- on the left, you have Add New CPT Form Field, and on the right, the available fields that will be displayed on Add New CPT Listing Form.
- 3
- You can choose between Standard Fields and Predefined Fields. There is a Custom Fields section, where developers can add their own custom fields via themes or plugins.
- 4
- To add a custom field, click on it in the left pane, and it will be added to the right pane. This is similar to the WordPress Widget Manager interface.
- 5
- When you're done customizing the field, click Save. Make sure you select the Is Active? option prior to saving.
If "Is Active" is unchecked, the custom field will not show up anywhere on the site.
Customizing the Custom Fields
Each custom field comes with its own set of options. You can tweak the settings as per your requirements. Also, each CPT can have its own set of custom fields, each with its own set of options.
You can click the "Show Advanced" button to view additional customizable options for each field, such as CSS properties.
Lastly, it is worth noting that certain fields can only be added once per CPT. For instance, you can add as many textarea fields as needed, but there can only be one video field per CPT.
Featured
For Pricing Manager Addon Users
Be sure to visit every field and adjust "Show only on these price packages".
When Pricing Manager is first enabled, if you have already created your custom fields, those fields will not be included in any pricing packages, and so they will appear to be missing from your form.
Simply return to the custom fields settings and select which packages will include the field. The fields will then be visible on the form when the appropriate package is selected.
Try using 'featured' in all your paid packages to easily feature those paid listings with GD Listings. Leave 'featured' out of free packages to exclude those listings.
Why
If your fields are not showing in the add or edit listing page, make sure to check these items:
- "Is Active" is CHECKED
- "Admin Only Edit" is UNCHECKED (if you are logged in as a subscriber user).
- "Show only on these price packages - select all packages here, especially your active package.
- Conditional fields - remove conditions.