• Hey, I’m using get_categories to get all categories that aren’t empty. But it’s returning a ‘count’ of 0 for categories that DO contain posts.

    This is occurring with a custom post type.

    Heres the specifics:

    In wordpress dashboard if I associate a post (of my customer post type) to a category, get_categories returns the correct count.

    BUT. If I use wp_set_post_terms to set the posts terms, and then call get_categories the count returns as 0. When I check the DB the term is correctly associated to the post.

    Any ideas would be greatly appreciated, thanks!

The topic ‘get_categories count shows 0 when not empty’ is closed to new replies.