{"id":899,"date":"2025-03-24T14:27:58","date_gmt":"2025-03-24T14:27:58","guid":{"rendered":"https:\/\/wpgeodirectory.com\/documentation\/article\/how-to-add-a-custom-field-to-custom-post-type\/"},"modified":"2025-04-03T15:24:19","modified_gmt":"2025-04-03T14:24:19","slug":"how-to-add-a-custom-field-to-custom-post-type","status":"publish","type":"gd_place","link":"https:\/\/wpgeodirectory.com\/documentation\/article\/how-tos\/how-to-add-a-custom-field-to-custom-post-type\/","title":{"rendered":"How to Add a Custom Field to Custom Post Type"},"content":{"rendered":"<p>\n\t 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.&nbsp;<\/p>\n<h2>Adding Custom Fields to CPT<\/h2>\n<dl>\n<dt>\n\t1\n\t<\/dt>\n<dd>\n\tNavigate <strong>CPT &gt; Settings &gt; Custom Fields.&nbsp;<\/strong> <\/dd>\n<p>\t<img width=\"523\" height=\"412\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-xsSr9K3Yhn.png\" class=\"attachment-large size-large\" alt=\"\" decoding=\"async\" loading=\"lazy\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-xsSr9K3Yhn.png 523w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-xsSr9K3Yhn-300x236.png 300w\" sizes=\"auto, (max-width: 523px) 100vw, 523px\" \/><\/p>\n<dt>\n\t2\n\t<\/dt>\n<dd>\n\tThe interface is divided in two panels &#8212; on the left, you have <strong>Add New CPT Form Field, <\/strong>and on the right, the available fields that will be displayed on <strong>Add New CPT Listing Form.&nbsp;<\/strong> <\/dd>\n<p>\t<img width=\"806\" height=\"1024\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-ehkkmQOUa1-806x1024.png\" class=\"attachment-large size-large\" alt=\"\" decoding=\"async\" loading=\"lazy\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-ehkkmQOUa1-806x1024.png 806w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-ehkkmQOUa1-236x300.png 236w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-ehkkmQOUa1-768x976.png 768w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-ehkkmQOUa1.png 1089w\" sizes=\"auto, (max-width: 806px) 100vw, 806px\" \/><\/p>\n<dt>\n\t3\n\t<\/dt>\n<dd>\n\tYou can choose between <strong>Standard Fields <\/strong>and <strong>Predefined Fields. <\/strong>There is a <strong>Custom Fields section, <\/strong>where developers can add their own custom fields via themes or plugins.&nbsp;\n\t<\/dd>\n<dt>\n\t4\n\t<\/dt>\n<dd>\n\tTo 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.&nbsp;\n\t<\/dd>\n<p>\t<img width=\"586\" height=\"555\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-JHpSIaqz10.png\" class=\"attachment-large size-large\" alt=\"\" decoding=\"async\" loading=\"lazy\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-JHpSIaqz10.png 586w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-JHpSIaqz10-300x284.png 300w\" sizes=\"auto, (max-width: 586px) 100vw, 586px\" \/><\/p>\n<dt>\n\t5\n\t<\/dt>\n<dd>\n\tWhen you&#8217;re done customizing the field, click <strong>Save. <\/strong>Make sure you select the <strong>Is Active? <\/strong>option prior to saving.&nbsp;\n\t<\/dd>\n<\/dl>\n<section class=\"alert alert-warning\">\n\t If <strong>&#8220;Is Active&#8221; <\/strong>is unchecked, the custom field will not show up anywhere on the site.&nbsp;<\/section>\n<h2>Customizing the Custom Fields<\/h2>\n<p>\n\t 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.&nbsp;<\/p>\n<section class=\"alert alert-success\">\n\t You can click the <strong>&#8220;Show Advanced&#8221; <\/strong>button to view additional customizable options for each field, such as CSS properties.&nbsp;<\/section>\n<p>\n\tLastly, it is worth noting that certain fields can only be added once per CPT. For instance, you can add as many&nbsp;<br \/>\n\t<b style=\"background-color: initial;\">textarea<\/b>&nbsp;fields as needed, but there can only be one&nbsp;<b style=\"background-color: initial;\">video<\/b>&nbsp;field per CPT.&nbsp;<\/p>\n<h2 id=\"featured\">Featured<\/h2>\n<p>\n\tFor Pricing Manager Addon Users<\/p>\n<p>\n\tBe sure to visit every field and adjust &#8220;Show only on these price packages&#8221;.<\/p>\n<p>\n\tWhen 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.<\/p>\n<p>\n\tSimply 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.<\/p>\n<p>\n\tTry using &#8216;featured&#8217; in all your paid packages to easily feature those paid listings with GD Listings. Leave &#8216;featured&#8217; out of free packages to exclude those listings.<\/p>\n<p>\n\t<img width=\"644\" height=\"1024\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-ZHZSg8uPvK-1-644x1024.png\" class=\"attachment-large size-large\" alt=\"\" decoding=\"async\" loading=\"lazy\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-ZHZSg8uPvK-1-644x1024.png 644w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-ZHZSg8uPvK-1-189x300.png 189w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-ZHZSg8uPvK-1-768x1221.png 768w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-ZHZSg8uPvK-1.png 856w\" sizes=\"auto, (max-width: 644px) 100vw, 644px\" \/><\/p>\n<h2 id=\"why\">Why<\/h2>\n<p>\n\tIf your fields are not showing&nbsp; in the add or edit listing page, make sure to check these items:<\/p>\n<ul>\n<li>&#8220;Is Active&#8221; is CHECKED<\/li>\n<li>&#8220;Admin Only Edit&#8221; is UNCHECKED (if you are logged in as a subscriber user).<\/li>\n<li>&#8220;Show only on these price packages &#8211; select all packages here, especially your active package.<\/li>\n<li>Conditional fields &#8211; remove conditions.<\/li>\n<\/ul>\n<p><img width=\"644\" height=\"1024\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-FoTtW890Gs-644x1024.png\" class=\"attachment-large size-large\" alt=\"\" decoding=\"async\" loading=\"lazy\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-FoTtW890Gs-644x1024.png 644w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-FoTtW890Gs-189x300.png 189w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-FoTtW890Gs-768x1221.png 768w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-FoTtW890Gs.png 857w\" sizes=\"auto, (max-width: 644px) 100vw, 644px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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.&nbsp; Adding Custom Fields to CPT 1 Navigate CPT &gt; Settings &gt; Custom Fields.&nbsp; 2 The interface is divided in two panels &#8212; on the left, you have Add New CPT [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"article\/tags":[553,580],"article\/categories":[211,432],"class_list":["post-899","gd_place","type-gd_place","status-publish","hentry","gd_place_tags-custom-post-types","gd_place_tags-custom-fields","gd_placecategory-tips-tricks-more","gd_placecategory-how-tos"],"_links":{"self":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/899","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=899"}],"version-history":[{"count":0,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/899\/revisions"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/media?parent=899"}],"wp:term":[{"taxonomy":"gd_place_tags","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/tags?post=899"},{"taxonomy":"gd_placecategory","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/categories?post=899"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}