1

I am trying to use <?php echo get_the_category_list(); ?> in my footer.php file to display my categories. On the home page, this function is showing only two categories and in inner single posts it shows that post's related category. In pages, this tag shows nothing. I have even tried to use <?php wp_reset_query(); ?> after each WP_Query, but that did not help.

How do I make this work properly?

0

1 Answer 1

4

get_the_category_list() shows categories that have been assigned to a particular post/page.

If you want a list of all categories you've defined then you should use wp_list_categories() (Link to Codex)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.