{"id":738,"date":"2025-03-24T14:27:33","date_gmt":"2025-03-24T14:27:33","guid":{"rendered":"https:\/\/wpgeodirectory.com\/documentation\/article\/custom-post-types-setup-guide\/"},"modified":"2025-04-03T15:23:53","modified_gmt":"2025-04-03T14:23:53","slug":"custom-post-types-setup-guide","status":"publish","type":"gd_place","link":"https:\/\/wpgeodirectory.com\/documentation\/article\/custom-post-types-extension\/custom-post-types-setup-guide\/","title":{"rendered":"Custom Post Types &#8211; Setup Guide"},"content":{"rendered":"<section class=\"alert alert-info\">\n\t This setup guide will run through a typical setup of the <a href=\"https:\/\/wpgeodirectory.com\/downloads\/custom-post-types\/\">Custom Post Types<\/a> extension from start to finish.<\/section>\n<h2>Overview<\/h2>\n<p>\n\t The <a href=\"https:\/\/wpgeodirectory.com\/downloads\/custom-post-types\/\">Custom Post Types<\/a> extension lets you create Custom Post types to help you build more powerful and detailed directories. It leverages the powerful <strong>CPT feature of WordPress<\/strong> to create distinct listing types.&nbsp;<\/p>\n<section class=\"alert alert-warning dashed\">\n\t For instance, if you are creating a medical directory, you can use the Custom Post Types extension to create separate listing types such as &#8220;Doctors&#8221;, &#8220;Hospitals&#8221;, and so on. Each CPT can then further be divided on the basis of <strong>Categories <\/strong>and <strong>Tags<\/strong><strong>, <\/strong>such as &#8220;Private Practitioners&#8221;, &#8220;ER Units&#8221;, &#8220;Cardiology&#8221;, etc.<\/section>\n<p>\n\t There is no limit to the number of CPTs that you can create. Each CPT will have its own <strong>Categories<\/strong> and <strong>Tags<\/strong>, as well as its own <strong>Form Builder<\/strong> for custom fields and other options. You can also create <strong>location-less CPTs,<\/strong> for entities that may not have a physical address.<\/p>\n<section class=\"alert alert-info\">\n\t For a <strong>full list of features see<\/strong> the <a href=\"https:\/\/wpgeodirectory.com\/downloads\/custom-post-types\/\">Custom Post Types product page.<\/a><a href=\"https:\/\/wpgeodirectory.com\/downloads\/location-manager\/\"><\/a><\/section>\n<h2>Installation<\/h2>\n<p>\n\t The <strong>first step<\/strong> if you haven&#8217;t already, is to <strong>install the Custom Post Types extension.<\/strong> This can be done by following our guides on <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/category\/installing-extensions\/\">how to install an extension.<\/a><\/p>\n<h2>Step 1 &#8211; Settings<\/h2>\n<p> <strong>Once installed and activated<\/strong>, you can find the Custom Post Types settings at <strong>GeoDirectory &gt; Settings &gt; Post Types<\/strong>.<\/p>\n<p>\n\t<img width=\"697\" height=\"433\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-u6wmnCvmfB.png\" class=\"attachment-large size-large\" alt=\"\" decoding=\"async\" loading=\"lazy\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-u6wmnCvmfB.png 697w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-u6wmnCvmfB-300x186.png 300w\" sizes=\"auto, (max-width: 697px) 100vw, 697px\" \/><\/p>\n<p>\n\t The Custom Post Types extension comes with <strong>sane defaults<\/strong> meaning the <strong>default settings will work for the majority of users<\/strong>, however, there are many customizations that can be done via the settings, for a full explanation of what all the settings do please see our <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/custom-post-types-extension\/settings-overview-for-post-type-cpt-settings-general\/\">settings overview. <br \/>\n\t<\/a><\/p>\n<h2>Step 2 &#8211; Adding CPTs<\/h2>\n<p>\n\t Creating a new CPT is possible from the settings&#8217; section. You can find details on this page &#8212; <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/custom-post-types-extension\/how-to-add-a-new-custom-post-type\/\">How to Create a New Custom Post Type. <br \/>\n\t<\/a><\/p>\n<p>\n\t Each CPT requires a new <strong>name<\/strong>, and its own <strong>slug<\/strong>. There are several other options that you can edit for every CPT that you add.&nbsp;<\/p>\n<p>\n\t<img width=\"770\" height=\"580\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-5bWoj9p4X8.png\" class=\"attachment-large size-large\" alt=\"\" decoding=\"async\" loading=\"lazy\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-5bWoj9p4X8.png 770w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-5bWoj9p4X8-300x226.png 300w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-5bWoj9p4X8-768x578.png 768w\" sizes=\"auto, (max-width: 770px) 100vw, 770px\" \/><\/p>\n<p>\n\t It is also possible to <strong>link two different CPTs to each other. <\/strong>You will need to add both the CPTs first, and then you can <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/custom-post-types-extension\/how-to-link-two-custom-post-types\/\">link them<\/a> accordingly.<\/p>\n<h2>Step 3 &#8211; Add Dummy Data<\/h2>\n<p>\n\t You can import dummy data for any CPT that you add. Refer to <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/first-steps\/add-dummy-data-recommended\/\">Add Dummy Data<\/a> for more details.&nbsp;<\/p>\n<section class=\"alert alert-danger\">\n\t When importing dummy data, make sure to uncheck <strong>&#8220;Update Page Templates&#8221; <\/strong>if you have made custom changes to archive items or details page templates &#8212; otherwise, your changes will be overwritten.<\/section>\n<p> <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/custom-post-types-extension\/how-to-add-a-new-custom-post-type\/\"><\/a><\/p>\n<h2>Step 4 &#8211; Add CPTs to Navigation Menus<\/h2>\n<p>\n\tOnce the CPT has been added you will want users to be able to find them  and to be able to add them. Head to <strong>Appearance &gt; Menus.<\/strong>&nbsp;<\/p>\n<p>\n\tUnder the  GeoDirectory endpoints section you can add the <strong>main archive<\/strong> link and a  link to the <strong>add listings page<\/strong> for the CPT.<\/p>\n<div>\n<p>\n\t\t<img width=\"298\" height=\"587\" src=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-QtRz3CSQol.png\" class=\"attachment-large size-large\" alt=\"\" decoding=\"async\" loading=\"lazy\" srcset=\"https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-QtRz3CSQol.png 298w, https:\/\/wpgeodirectory.com\/documentation\/wp-content\/uploads\/2025\/03\/file-QtRz3CSQol-152x300.png 152w\" sizes=\"auto, (max-width: 298px) 100vw, 298px\" \/>\n\t<\/p>\n<p>\t &nbsp;\n<\/p><\/div>\n<h2>Step 5 &#8211; CPT Listings Widget<\/h2>\n<p>\n\t The Custom Post Types extension comes with its own <strong>CPT Listings <\/strong>widget that can be used to list CPTs in any widget area on your website. Once you are done adding the CPT listings, you may consider <strong>adding the CPT Listings widget<\/strong> to your sidebar\/footer or other widget areas to help users <strong>easily access<\/strong> the CPT listings.<\/p>\n<p>\n\t The widget has the option to <strong> exclude certain CPTs,<\/strong> or <strong>show\/hide specific options.<\/strong> You can find details about its usage on the <strong><\/strong><a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/custom-post-types-extension\/gd-cpt-listings\/\">GD CPT Listings widget<\/a> page. <strong><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This setup guide will run through a typical setup of the Custom Post Types extension from start to finish. Overview The Custom Post Types extension lets you create Custom Post types to help you build more powerful and detailed directories. It leverages the powerful CPT feature of WordPress to create distinct listing types.&nbsp; For instance, [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"article\/tags":[553,554,576,577],"article\/categories":[213,423],"class_list":["post-738","gd_place","type-gd_place","status-publish","hentry","gd_place_tags-custom-post-types","gd_place_tags-geodirectory-extensions","gd_place_tags-adding-custom-post-types","gd_place_tags-cpt-settings","gd_placecategory-extensions-features","gd_placecategory-custom-post-types-extension"],"_links":{"self":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/738","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=738"}],"version-history":[{"count":0,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/738\/revisions"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/media?parent=738"}],"wp:term":[{"taxonomy":"gd_place_tags","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/tags?post=738"},{"taxonomy":"gd_placecategory","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/categories?post=738"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}