{"id":2909,"date":"2026-10-20T08:37:21","date_gmt":"2026-10-20T07:37:21","guid":{"rendered":"https:\/\/wpgeodirectory.com\/documentation\/article\/categories-and-subcategories\/"},"modified":"2026-10-20T08:37:21","modified_gmt":"2026-10-20T07:37:21","slug":"categories-and-subcategories","status":"publish","type":"gd_place","link":"https:\/\/wpgeodirectory.com\/documentation\/article\/core-features\/categories-and-subcategories\/","title":{"rendered":"How categories and subcategories work in GeoDirectory"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">GeoDirectory categories work like WordPress categories: any category can have a parent, so you can build as many levels as you need. A few things behave differently from what people expect, mainly in URLs and breadcrumbs.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Creating subcategories<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Go to Places > Place Categories (or the categories page of your post type).<\/li>\n\n\n\n<li>Add the parent category first.<\/li>\n\n\n\n<li>Add the subcategory and choose the parent in the Parent Category dropdown.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">See <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/first-steps\/create-a-category\/\">create a category<\/a> for the other category settings such as icons and images.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Assigning a listing<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A listing can be in several categories, see <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/how-tos\/can-i-place-a-listing-in-multiple-categories\/\">can I place a listing in multiple categories<\/a>. We recommend ticking both the parent and the subcategory, so the listing shows up wherever either is used. One of the ticked categories is the default category, which GeoDirectory uses for the listing&#8217;s URL, marker icon and breadcrumb. More on that in <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/how-tos\/what-is-the-default-category-field-for\/\">what the default category field is for<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">URLs and breadcrumbs<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A listing URL contains only one category, the default category, for example <code>\/places\/hostels\/listing-name\/<\/code>. It does not include the parent as well, and there is no setting to add the full parent and child path.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Category page URLs also use only the category&#8217;s own slug. A subcategory&#8217;s URL does not include its parent&#8217;s slug.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On the listing page, breadcrumbs show the default category. To have the subcategory appear, set it as the default category on the listing.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Showing the category tree<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To list categories with their subcategories on a page, use <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/core-widgets\/gd-categories\/\">GD > Categories<\/a>. Set Max sub-cat depth for how many levels to show and Max sub-cat to show for how many children to list under each parent.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>GeoDirectory categories work like WordPress categories: any category can have a parent, so you can build as many levels as you need. A few things behave differently from what people expect, mainly in URLs and breadcrumbs. Creating subcategories See create a category for the other category settings such as icons and images. Assigning a listing [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"","ping_status":"closed","template":"","meta":{"footnotes":""},"article\/tags":[],"article\/categories":[421,213],"class_list":["post-2909","gd_place","type-gd_place","status-publish","hentry","gd_placecategory-core-features","gd_placecategory-extensions-features"],"_links":{"self":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2909","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"}],"author":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/comments?post=2909"}],"version-history":[{"count":0,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2909\/revisions"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/media?parent=2909"}],"wp:term":[{"taxonomy":"gd_place_tags","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/tags?post=2909"},{"taxonomy":"gd_placecategory","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/categories?post=2909"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}