hide_empty=0 not working
-
Hello,
thank you for the nice plugin. Works great for me, with all the shortcode attributes, with one exception: hide_empty=0 does not hide empty categories.
Any idea what I could check?
Thanks
Herbert
-
Hi,
Strange, because here it’s working fine, it does display an empty (sub)category when I use for example this shortcode:
[knowledgebase hide_empty=0]Are you having another active loop on your page perhaps? For example a list of blog posts or events? It might conflict.
Guido
Hi Guido,
I’m confused. Your reply “…, it does display an empty (sub)category …” basically means the shortcode does NOT hide empty categories. I thought it would hide them.
I have a few empty categories. There is no difference in what I get between [knowledgebase] and [knowledgebase hide_empty=0]
best regards
Wait! I was confused. They are hidden by default, the hide_empty attribute is to display empty categories..
I have tested plugin and it does work fine here… Check this temp link where I added 2 shortcode links:
[knowledgebase] [knowledgebase hide_empty=0]Your problem occurs with the default WP categories?
Guido
Hi Guido,
thank you for your replies. I found it works as you outlined here.
I had an issue in my WordPress setup. I play around with various plugins, themes etc. in a WP implementation I set up for testing only. Somes of the categories show entries >0, although it’s nothing there. So your plugin shows the category names, but no entries, which is correct in these cases.
I’m sorry for the confusion.
Thanks
Merry Christmas for you and your familiesGuido,
one thing I want to add here. The theme I use comes with a plugin that installs “projects” which use the same categories as posts. In reverse, if I add projects and additional categories for them and do not use these categories for posts, the categories will show up with both [knowledgebase] and [knowledgebase hide_empty=0] and no posts will be listed.
best regards
HerbertHi Herbert,
The “projects” post type should have it’s own categories, but apparently the developer has chosen to use the default (post) categories for that as well. But my plugin does not list posts from a custom post type (such as “projects”). So that’s why hide_empty behaves strange.
You can exclude your “projects” categories so they will not be listed:
[knowledgebase exclude=8,10,12]I wish you a merry Christmas as well 🙂
Guido
Hi Guido,
thanks for the reply. Yes I already figured that out earlier today (and I have it working!!). After loading new plugins, activating, deactivating and deleting them after testing I believe I got confused a bit with my implementation and didn’t think about the possibility custom post types using the default post categories.
Thanks for the nice plugin.
Best regards
HerbertI might add a new shortcode attribute, to list “posts” from a custom post type (events, products, etc)… but have to look into this first. It’s very important they use the same structure as regular posts otherwise it fails.
Guido
Hi Guido,
the theme I’m using is ‘Talon’ from athemes.com. They also offer demo content ttps://athemes.com/documentation/talon/#. I’m not sure if you need to download the demo content to get the custom post types.
May be this helps.
Best regards
HerbertHi Herbert,
I have updated plugin. You can list custom post types too. More info here.
It also works with your theme. But because your theme uses the default “category” taxonomy for all post types, you should still use the hide parameter to hide certain categories.
Guido
The topic ‘hide_empty=0 not working’ is closed to new replies.