{"id":938,"date":"2025-03-24T14:28:05","date_gmt":"2025-03-24T14:28:05","guid":{"rendered":"https:\/\/wpgeodirectory.com\/documentation\/article\/how-to-use-conditional-fields-settings\/"},"modified":"2025-04-03T15:24:25","modified_gmt":"2025-04-03T14:24:25","slug":"how-to-use-conditional-fields-settings","status":"publish","type":"gd_place","link":"https:\/\/wpgeodirectory.com\/documentation\/article\/how-tos\/how-to-use-conditional-fields-settings\/","title":{"rendered":"How to use conditional fields settings?"},"content":{"rendered":"<p>\n\tYou can hide or show fields in the add listing form with the Conditional Fields feature.<\/p>\n<h2>How to Add Conditional Fields?&nbsp;<\/h2>\n<p>\n\tConditional Fields settings can be found inside the individual field settings in the Custom Fields tab.<\/p>\n<p>\n\tCPT &gt; Settings &gt; Custom Fields &gt; Edit Fields -&gt; Conditional Fields&nbsp;<\/p>\n<p>\n\t<img width=\"585\" height=\"482\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-xfYFF0bikF-1.png\" class=\"attachment-large size-large\" alt=\"\" decoding=\"async\" loading=\"lazy\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-xfYFF0bikF-1.png 585w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-xfYFF0bikF-1-300x247.png 300w\" sizes=\"auto, (max-width: 585px) 100vw, 585px\" \/><\/p>\n<h3>\nMake field conditional based on a category of the listing<\/h3>\n<p>\n\tIt is possible to show or hide a field based on whether a category is or isn&#8217;t present on the listing.<\/p>\n<p>\n\tUse the &#8220;contains&#8221; to pick your value out of the list of categories stored with the listing.<\/p>\n<p>\n\tUse the Category ID instead of the category name. For example, if the category &#8220;Attractions&#8221; has Category ID 22, then place 22 in the match column.<\/p>\n<p>\n\t<img width=\"829\" height=\"147\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-iEsSrbcgQk-1.png\" class=\"attachment-large size-large\" alt=\"\" decoding=\"async\" loading=\"lazy\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-iEsSrbcgQk-1.png 829w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-iEsSrbcgQk-1-300x53.png 300w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-iEsSrbcgQk-1-768x136.png 768w\" sizes=\"auto, (max-width: 829px) 100vw, 829px\" \/><\/p>\n<h3>GeoDirectory&#8217;s Conditional Filters for Advanced Search<\/h3>\n<p>\n\tAdvanced search addon allows you to make search filters conditional, too.<\/p>\n<p>\n\tThis is especially targeted to support filters &#8216;by category&#8217;.<\/p>\n<p>\n\tYou can set up first a multi-select field in a CPT that only shows based on a category like shown above.<\/p>\n<p>\n\tThen in the search configuration you can display that filter only if the visitor has already engaged a category filter using the id of the category, as shown in the screenshot below.<\/p>\n<p>\n\tRead more about Advanced Search Filters <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/category\/advanced-search\/\" target=\"_blank\">here<\/a>.<\/p>\n<p>\n\t<img width=\"920\" height=\"605\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-eTDwackOdn-1024x673.png\" class=\"attachment-large size-large\" alt=\"\" decoding=\"async\" loading=\"lazy\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-eTDwackOdn-1024x673.png 1024w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-eTDwackOdn-300x197.png 300w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-eTDwackOdn-768x505.png 768w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-eTDwackOdn-1536x1009.png 1536w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-eTDwackOdn.png 1612w\" sizes=\"auto, (max-width: 920px) 100vw, 920px\" \/><\/p>\n<p>Troubleshooting GeoDirectory Conditional Fields&nbsp;<\/p>\n<p>Conditional Field Settings not Showing? &#8211; Requires Bootstrap Styles<\/p>\n<p>GeoDirectory Conditional Fields requires bootstrap design styles. If you don&#8217;t see the conditional fields settings, it may be that your site has the legacy settings in place.<\/p>\n<p>Check this setting to turn bootstrap styles back on to access conditional fields.<\/p>\n<p>WP Admin &#8211; GeoDirectory &#8211; Settings &#8211; General &#8211; Developer &#8211; Default Design Style<\/p>\n<p>Conditional Category Settings<\/p>\n<p>When you want a field or filter to show based on a category, be sure to set the category ID, as opposed to the category label and use &#8216;contains&#8217; instead of is equal.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can hide or show fields in the add listing form with the Conditional Fields feature. How to Add Conditional Fields?&nbsp; Conditional Fields settings can be found inside the individual field settings in the Custom Fields tab. CPT &gt; Settings &gt; Custom Fields &gt; Edit Fields -&gt; Conditional Fields&nbsp; Make field conditional based on a [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"article\/tags":[795],"article\/categories":[211,432],"class_list":["post-938","gd_place","type-gd_place","status-publish","hentry","gd_place_tags-conditional-fields","gd_placecategory-tips-tricks-more","gd_placecategory-how-tos"],"_links":{"self":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/938","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=938"}],"version-history":[{"count":0,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/938\/revisions"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/media?parent=938"}],"wp:term":[{"taxonomy":"gd_place_tags","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/tags?post=938"},{"taxonomy":"gd_placecategory","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/categories?post=938"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}