{"id":741,"date":"2025-03-24T14:27:33","date_gmt":"2025-03-24T14:27:33","guid":{"rendered":"https:\/\/wpgeodirectory.com\/documentation\/article\/adding-options-to-geodirectory-custom-fields\/"},"modified":"2025-04-03T15:23:54","modified_gmt":"2025-04-03T14:23:54","slug":"adding-options-to-geodirectory-custom-fields","status":"publish","type":"gd_place","link":"https:\/\/wpgeodirectory.com\/documentation\/article\/core-features\/adding-options-to-geodirectory-custom-fields\/","title":{"rendered":"Adding Options to GeoDirectory Custom Fields"},"content":{"rendered":"<p>\n\t GeoDirectory custom fields can be added to any CPT form, to display any type of content. For instance, you can add custom fields to display listing address, phone, email, and so on.&nbsp;<\/p>\n<p>\n\t You can also add custom options to certain custom fields, namely, <strong>radio, select <\/strong>and <strong>multi-select <\/strong>fields. This guide will explain how to add options to custom fields.&nbsp;<\/p>\n<h2>Adding Options to Custom Fields<\/h2>\n<dl>\n<dt>\n\t1\n\t<\/dt>\n<dd>\n\tNavigate to <strong>CPT &gt; Settings &gt; Custom Fields.&nbsp;<\/strong> <\/dd>\n<p>\t<img width=\"651\" height=\"515\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-DlGqbFN0rP.png\" class=\"attachment-large size-large\" alt=\"\" decoding=\"async\" loading=\"lazy\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-DlGqbFN0rP.png 651w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-DlGqbFN0rP-300x237.png 300w\" sizes=\"auto, (max-width: 651px) 100vw, 651px\" \/><\/p>\n<dt>\n\t2\n\t<\/dt>\n<dd> <strong><\/strong>Next, you need to add the fields to the form, simply by clicking on the field name. Again, options can be added to <strong style=\"background-color: initial;\">Radio, Select <\/strong>and <strong style=\"background-color: initial;\">Multi-Select <\/strong>fields.&nbsp;\n\t<\/dd>\n<p>\t<img width=\"920\" height=\"572\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-1Znkllcduf-1024x637.png\" class=\"attachment-large size-large\" alt=\"\" decoding=\"async\" loading=\"lazy\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-1Znkllcduf-1024x637.png 1024w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-1Znkllcduf-300x187.png 300w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-1Znkllcduf-768x478.png 768w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-1Znkllcduf.png 1082w\" sizes=\"auto, (max-width: 920px) 100vw, 920px\" \/><\/p>\n<dt>\n\t3\n\t<\/dt>\n<dd>\n\tYou can then specify your options in the <strong>Option Values <\/strong>section of the custom field.&nbsp;\n\t<\/dd>\n<p>\t<img width=\"920\" height=\"572\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-v2EcWoaL8v-1024x637.png\" class=\"attachment-large size-large\" alt=\"\" decoding=\"async\" loading=\"lazy\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-v2EcWoaL8v-1024x637.png 1024w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-v2EcWoaL8v-300x187.png 300w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-v2EcWoaL8v-768x478.png 768w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-v2EcWoaL8v.png 1082w\" sizes=\"auto, (max-width: 920px) 100vw, 920px\" \/><\/p>\n<dt>\n\t4\n\t<\/dt>\n<dd>\n\tBe sure to <strong>Save <\/strong>your settings.&nbsp;\n\t<\/dd>\n<\/dl>\n<h2> Additional Info<\/h2>\n<p>\n\t Adding options to your custom fields is a good way to help users sort content. Here are some points to bear in mind:&nbsp;<\/p>\n<ul>\n<li> The option values that you specify should be comma-separated. For instance, if you have added a <strong>Select <\/strong>field titled <strong>&#8220;Property Condition&#8221;, <\/strong>you can add options as <strong>&#8220;New,Renovated,Needs Repair,Dilapidated&#8221;. <\/strong>Each of these four options will be selectable to users. Alternatively, you can add these options to <strong>Multi-Select <\/strong>field, wherein users can select multiple options.&nbsp;<\/li>\n<li> If you need to add filterable options, you need to place a \/ (forward slash) followed by a 0 (zero) or 1 (one) to specify false and true, respectively. For example, <strong>&#8220;Non-Smoking\/0,Smoking\/1&#8221;. <\/strong>This can help users easily shortlist listings of their choice. Note that Tick-to-Filter values work only with Select field, not with Multi-Select.&nbsp;<\/li>\n<li>You can also work with placeholder options, for instance, for <strong>Select <\/strong>field, you can use&nbsp;<strong>Status\/,Unfurnished,Furnished,Partially furnished,Optional. <\/strong>In this case, if you do not use the , (comma) before the first option, it will be excluded from the list.&nbsp;<\/li>\n<\/ul>\n<section class=\"alert alert-warning\">\n\t If using OPTGROUP tag to grouping options, use <strong>&#8220;{optgroup}OPTGROUP-LABEL|OPTION-1,OPTION-2{\/optgroup}&#8221;.&nbsp;<\/strong><\/section>\n<h2>Output<\/h2>\n<p>\n\t Adding options to <strong>Select <\/strong>field titled <strong>&#8220;<\/strong><strong>Status&#8221;<\/strong>:&nbsp;<\/p>\n<p>\n\t<img width=\"576\" height=\"512\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-aprfEMFq0c.png\" class=\"attachment-large size-large\" alt=\"\" decoding=\"async\" loading=\"lazy\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-aprfEMFq0c.png 576w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-aprfEMFq0c-300x267.png 300w\" sizes=\"auto, (max-width: 576px) 100vw, 576px\" \/><\/p>\n<p>\n\t Output on the frontend:&nbsp;<\/p>\n<p>\n\t<img width=\"629\" height=\"321\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-mhWt5F3cNJ.png\" class=\"attachment-large size-large\" alt=\"\" decoding=\"async\" loading=\"lazy\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-mhWt5F3cNJ.png 629w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-mhWt5F3cNJ-300x153.png 300w\" sizes=\"auto, (max-width: 629px) 100vw, 629px\" \/><\/p>\n<p>\n\t Adding options to <strong>Radio <\/strong>field titled <strong>&#8220;Status&#8221;:&nbsp;<\/strong><\/p>\n<p>\n\t<img width=\"564\" height=\"494\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-DVRs7lMZa2.png\" class=\"attachment-large size-large\" alt=\"\" decoding=\"async\" loading=\"lazy\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-DVRs7lMZa2.png 564w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-DVRs7lMZa2-300x263.png 300w\" sizes=\"auto, (max-width: 564px) 100vw, 564px\" \/><\/p>\n<p>\n\t Output on the frontend:&nbsp;<\/p>\n<p>\n\t<img width=\"633\" height=\"310\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-VNUJjqeT9n.png\" class=\"attachment-large size-large\" alt=\"\" decoding=\"async\" loading=\"lazy\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-VNUJjqeT9n.png 633w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-VNUJjqeT9n-300x147.png 300w\" sizes=\"auto, (max-width: 633px) 100vw, 633px\" \/><\/p>\n<p>\n\t Adding options to&nbsp; <strong>Multi-Select<\/strong>&nbsp;field titled&nbsp;<strong>&#8220;Status&#8221;:<\/strong>&nbsp;<\/p>\n<p>\n\t<img width=\"574\" height=\"502\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-lbaGPc7Xg3.png\" class=\"attachment-large size-large\" alt=\"\" decoding=\"async\" loading=\"lazy\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-lbaGPc7Xg3.png 574w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-lbaGPc7Xg3-300x262.png 300w\" sizes=\"auto, (max-width: 574px) 100vw, 574px\" \/><\/p>\n<p>\n\t Output on the frontend:&nbsp;<\/p>\n<p>\n\t<img width=\"624\" height=\"364\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-VLQVFt4yJL.png\" class=\"attachment-large size-large\" alt=\"\" decoding=\"async\" loading=\"lazy\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-VLQVFt4yJL.png 624w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-VLQVFt4yJL-300x175.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/p>\n<h2>How to Add Conditional Fields?&nbsp;<\/h2>\n<p>\n\tConditional Fields can be added by heading to&nbsp; <strong>CPT &gt; Settings &gt; Custom Fields &gt; Edit Fields.&nbsp;<\/strong><\/p>\n<p>\n\t<img width=\"585\" height=\"482\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-xfYFF0bikF.png\" class=\"attachment-large size-large\" alt=\"\" decoding=\"async\" loading=\"lazy\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-xfYFF0bikF.png 585w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-xfYFF0bikF-300x247.png 300w\" sizes=\"auto, (max-width: 585px) 100vw, 585px\" \/><\/p>\n<p>\n\tThe Conditional Fields option therein allows you to specify&nbsp;conditions for that particular field to show\/hide on the frontend.&nbsp;Based on conditions that you specify, the fields will show\/hide on the Add Listing page.&nbsp;<\/p>\n<p>\n\tShow a field when a specific category is selected<\/p>\n<p>\n\tIf you want to use conditional fields with categories, use the category ID and the option &#8220;contains&#8221;.&nbsp; This is a great way to keep your add listing form tidy if you have added fields that are specific to listings grouped by category.<\/p>\n<p>\n\t<img width=\"829\" height=\"147\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-iEsSrbcgQk.png\" class=\"attachment-large size-large\" alt=\"\" decoding=\"async\" loading=\"lazy\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-iEsSrbcgQk.png 829w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-iEsSrbcgQk-300x53.png 300w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-iEsSrbcgQk-768x136.png 768w\" sizes=\"auto, (max-width: 829px) 100vw, 829px\" \/><\/p>\n<h2>\nMultiselect Field type option groups<br \/>\n<\/h2>\n<p>\n\tWhen adding a Multiselect you can include a &#8216;group&#8217; label that cannot be selected but that groups the options together in a list inside the field view on the form.<\/p>\n<p>\n\tHere is an example adding a group for Electronics, such that TV and Laptop will be shown as the actual options, and Electronics is only a label and cannot be selected.<\/p>\n<pre>For Sale \nunder-offer : Under Offer \noptgroup : Electronics \nTV\nLaptop\noptgroup-close\n<\/pre>\n<p>This will look like this in the field options if you copy the spacing and formatting exactly as above.<\/p>\n<p>\n<img width=\"337\" height=\"259\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-O7hdD6SfLy.png\" class=\"attachment-large size-large\" alt=\"\" decoding=\"async\" loading=\"lazy\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-O7hdD6SfLy.png 337w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-O7hdD6SfLy-300x231.png 300w\" sizes=\"auto, (max-width: 337px) 100vw, 337px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>GeoDirectory custom fields can be added to any CPT form, to display any type of content. For instance, you can add custom fields to display listing address, phone, email, and so on.&nbsp; You can also add custom options to certain custom fields, namely, radio, select and multi-select fields. This guide will explain how to add [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"article\/tags":[583,580,581,582],"article\/categories":[421,213],"class_list":["post-741","gd_place","type-gd_place","status-publish","hentry","gd_place_tags-select-field","gd_place_tags-custom-fields","gd_place_tags-adding-custom-fields","gd_place_tags-multi-option-fields","gd_placecategory-core-features","gd_placecategory-extensions-features"],"_links":{"self":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/741","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article"}],"about":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/types\/gd_place"}],"replies":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/comments?post=741"}],"version-history":[{"count":0,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/741\/revisions"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/media?parent=741"}],"wp:term":[{"taxonomy":"gd_place_tags","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/tags?post=741"},{"taxonomy":"gd_placecategory","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/categories?post=741"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}