{"id":2380,"date":"2026-10-20T08:32:20","date_gmt":"2026-10-20T07:32:20","guid":{"rendered":"https:\/\/wpgeodirectory.com\/documentation\/article\/shortcode-display-all-categories\/"},"modified":"2026-10-20T08:40:40","modified_gmt":"2026-10-20T07:40:40","slug":"shortcode-display-all-categories","status":"publish","type":"gd_place","link":"https:\/\/wpgeodirectory.com\/documentation\/article\/core-widgets\/shortcode-display-all-categories\/","title":{"rendered":"Shortcode to display all GeoDirectory categories"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Use the GD &gt; Categories shortcode, <code>&#091;gd_categories&#093;<\/code>. With these settings it lists every category of a post type, including subcategories and categories that have no listings yet:<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-markup\">&#091;gd_categories post_type=&#039;gd_place&#039; hide_empty=&#039;0&#039; max_count=&#039;all&#039; max_level=&#039;all&#039; max_count_child=&#039;all&#039; no_cat_filter=&#039;1&#039; sort_by=&#039;az&#039;&#093;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">What each setting does<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>post_type=&#039;gd_place&#039;<\/code> picks the post type. Leave it out to use the current one.<\/li>\n\n\n\n<li><code>hide_empty=&#039;0&#039;<\/code> keeps categories with no listings. Set it to 1 to hide them.<\/li>\n\n\n\n<li><code>max_count=&#039;all&#039;<\/code> shows all top level categories.<\/li>\n\n\n\n<li><code>max_level=&#039;all&#039;<\/code> shows every level of subcategory. The default is 1 level.<\/li>\n\n\n\n<li><code>max_count_child=&#039;all&#039;<\/code> shows all subcategories under each parent.<\/li>\n\n\n\n<li><code>no_cat_filter=&#039;1&#039;<\/code> shows the full list on category pages too, instead of only the children of the category being viewed.<\/li>\n\n\n\n<li><code>sort_by=&#039;az&#039;<\/code> sorts alphabetically. Other options are count, parent, term_order and include (the order you list the IDs in).<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">To show some categories only, add <code>filter_ids=&#039;21,8,43&#039;<\/code>. To leave some out, use negative IDs: <code>filter_ids=&#039;-21,-8&#039;<\/code>. Set <code>hide_count=&#039;1&#039;<\/code> to remove the listing numbers.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The same options are in the block and widget settings. You can see them all in the <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/core-widgets\/shortcode-builder\/\">shortcode builder<\/a> and in <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/core-widgets\/gd-categories\/\">GD &gt; Categories<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Use the GD &gt; Categories shortcode, &#091;gd_categories&#093;. With these settings it lists every category of a post type, including subcategories and categories that have no listings yet: What each setting does To show some categories only, add filter_ids=&#039;21,8,43&#039;. To leave some out, use negative IDs: filter_ids=&#039;-21,-8&#039;. Set hide_count=&#039;1&#039; to remove the listing numbers. The same [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"article\/tags":[],"article\/categories":[213,422],"class_list":["post-2380","gd_place","type-gd_place","status-publish","hentry","gd_placecategory-extensions-features","gd_placecategory-core-widgets"],"_links":{"self":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2380","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=2380"}],"version-history":[{"count":2,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2380\/revisions"}],"predecessor-version":[{"id":2655,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2380\/revisions\/2655"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/media?parent=2380"}],"wp:term":[{"taxonomy":"gd_place_tags","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/tags?post=2380"},{"taxonomy":"gd_placecategory","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/categories?post=2380"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}