{"id":2597,"date":"2026-10-20T08:35:20","date_gmt":"2026-10-20T07:35:20","guid":{"rendered":"https:\/\/wpgeodirectory.com\/documentation\/article\/show-subcategories-on-category-page\/"},"modified":"2026-10-20T08:39:38","modified_gmt":"2026-10-20T07:39:38","slug":"show-subcategories-on-category-page","status":"publish","type":"gd_place","link":"https:\/\/wpgeodirectory.com\/documentation\/article\/how-tos\/show-subcategories-on-category-page\/","title":{"rendered":"How to show subcategories and their listings on a GeoDirectory category page"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">You can give each parent category page a row of subcategory links above its listings with the GD &gt; Categories block. Visitors click a subcategory to see only those listings, and the parent page lists all of them with paging.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Add the subcategory row<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Go to GeoDirectory &gt; Settings &gt; General &gt; Pages and open the page set as <em>Archive page<\/em>. All category pages use it.<\/li>\n\n\n\n<li>Add a GD &gt; Categories block above the GD &gt; Loop block.<\/li>\n\n\n\n<li>Leave <em>Tick to show all the categories<\/em> unticked. On a category page the block then shows only the child categories of the category being viewed.<\/li>\n\n\n\n<li>Pick a design and the number of items per row, then update the page.<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-markup\">&#091;gd_categories row_items=&#039;5&#039; hide_empty=&#039;1&#039;&#093;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">When you open a subcategory, its page uses the same template, so the row shows that subcategory&#8217;s own children if it has any.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Sorting and view switcher<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The GD &gt; Loop Actions block, already on the Archive page by default, gives visitors the sort options and the grid or list view switch.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">A fixed list for one category<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you want a page that always shows one category, use GD &gt; Listings with the category set, for example <code>&#091;gd_listings post_type=&#039;gd_place&#039; category=&#039;12&#039; post_limit=&#039;10&#039;&#093;<\/code>. Use the category ID from Places &gt; Place Categories.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In GeoDirectory v1 this needed the Custom Post Types add-on and its own categories shortcode. That is no longer the case: GD &gt; Categories is part of the core plugin.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For filtering search results by category, see <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/how-tos\/how-to-filter-search-results-by-category\/\">How to filter search results by category?<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can give each parent category page a row of subcategory links above its listings with the GD &gt; Categories block. Visitors click a subcategory to see only those listings, and the parent page lists all of them with paging. Add the subcategory row When you open a subcategory, its page uses the same template, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"article\/tags":[],"article\/categories":[211,432],"class_list":["post-2597","gd_place","type-gd_place","status-publish","hentry","gd_placecategory-tips-tricks-more","gd_placecategory-how-tos"],"_links":{"self":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2597","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=2597"}],"version-history":[{"count":1,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2597\/revisions"}],"predecessor-version":[{"id":2780,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2597\/revisions\/2780"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/media?parent=2597"}],"wp:term":[{"taxonomy":"gd_place_tags","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/tags?post=2597"},{"taxonomy":"gd_placecategory","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/categories?post=2597"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}