• I’m working with 4 categories. All appear in the admin normally and appear and work with posts as expected. But these functions are not producing the expected results:

    1. $foo = get_categories();
    Expected result: array(4)
    Actual result: array()

    2. $bar = get_all_category_ids();
    Expected result: array(4)
    Actual result: array()

    3. $baz = get_the_category();
    Expect result: array(4)
    Actual result: array(3)
    (the “Blog” category is absent)

    I must be missing something painfully obvious since the documentation for <b>get_all_category_ids</b> is only 30 words. Any thoughts? It’s late and I’d rather not spend hours taking apart /wp-includes/category.php line by line.

    Cheers,

  • The topic ‘get_categories empty, get_the_category not’ is closed to new replies.