GeoDirectory SupportOnly Show Categories with Listings in Menu – GeoDirectory Support https://wpgeodirectory.com/support/topic/only-show-categories-with-listings-in-menu/feed Tue, 03 Feb 2026 10:16:01 +0000 http://bbpress.org/?v=2.5.14-6684 en-US https://wpgeodirectory.com/support/topic/only-show-categories-with-listings-in-menu/#post-12421 <![CDATA[Only Show Categories with Listings in Menu]]> https://wpgeodirectory.com/support/topic/only-show-categories-with-listings-in-menu/#post-12421 Mon, 18 Aug 2014 10:54:22 +0000 purpleedge Anyone know of an easy-to-implement menu hack that will only show categories which have listings?

I’m adding quite a few categories to my menu and it’s a bit of a pain to do it manually, and I don’t want links to empty categories.

]]>
https://wpgeodirectory.com/support/topic/only-show-categories-with-listings-in-menu/#post-12488 <![CDATA[Reply To: Only Show Categories with Listings in Menu]]> https://wpgeodirectory.com/support/topic/only-show-categories-with-listings-in-menu/#post-12488 Mon, 18 Aug 2014 17:26:18 +0000 Paolo Hi Purpleedge,

currently the only way to add categories to the main menu is through wordpress menu interface adding them 1 by one.

In that case the category link will be displayed no matter if the category is empty or not.

Given that this would be a wordpress hack, rather than a GD hack, I’ve googled “wordpress menu hide item if empty category” and I haven’t found a proper hack that would hook into the wordpress menu to hide empty categories. In wordpress forums the answer is:

If you’ve added a link for a category to a custom menu, you can’t then dynamically hide it “on empty”. Just don’t add these links to your custom menus(s) unless you have at least 1 post in the relevant category.

and even though it is 3 years old, I haven’t found anything that wouldn’t require hacking the theme menu, like explained here : http://wordpress.org/support/topic/hide-empty-categories-in-wp_nav_menu

So, it doesn’t seems like there is any easy hack for this…

Thanks

]]>
https://wpgeodirectory.com/support/topic/only-show-categories-with-listings-in-menu/#post-12517 <![CDATA[Reply To: Only Show Categories with Listings in Menu]]> https://wpgeodirectory.com/support/topic/only-show-categories-with-listings-in-menu/#post-12517 Mon, 18 Aug 2014 23:16:53 +0000 purpleedge Thanks Paolo,

I actually came across this plugin that might be able to do it? As soon as I have a spare minute I’ll have a look and report back.

https://wordpress.org/plugins/category-posts-in-custom-menu/

The WP menu manager is a pain, especially when the menu gets big, so another solution might entail going to a page with the GD categories listed and use that as a navigation aid.

]]>