Greetings!
Is there any way to list all categories (not only those for the current post) on a post's page (single.php)?
I've been searching for 5 hours now and found no solution, every query I've tried relates to the current post / loop.
Thank you!
Greetings!
Is there any way to list all categories (not only those for the current post) on a post's page (single.php)?
I've been searching for 5 hours now and found no solution, every query I've tried relates to the current post / loop.
Thank you!
Tried both solutions, they only retrieve categories for the current post for some reason.
I need to list all categories, not just those for the current post, both empty or not.
If <?php wp_list_categories(); ?> only gives categories of the current post.
try:
- deactivating all plugins to see if this resolves the problem? If this works, re-activate the plugins one by one until you find the problematic plugin(s).
- switching to the default theme to rule out any theme-specific problems?
Thank you for your prompt replies, keesiemeijer.
I've modified single.php on the default theme before activating it and wp_list_categories(); works as it's supposed to.
Now I'm digging through the other theme's code to find the culprit.
Hopefully it's nothing too silly that's preventing wp_list_categories(); from working properly or I'll look like a complete fool.
What theme are you using?
A custom theme, started by someone else and taken over by yours truly.
Is there something simular to: add_filter('wp_list_categories', 'function_name'); in your functions.php
Yes, keesiemeijer that's exactly what it was. A function filtering the output of wp_list_categories(). I missed it on the first pass because of spaghetti code.
Thank you for your support, much appreciated!
You must log in to post.