Support » Fixing WordPress » get_the_category() is STILL broken…

  • The template function “get_the_category” is still broken and has been for a while — let me explain, please refer to my blog category here:

    Adding ?example to the end of the URL will give a print_r of get_the_category() for now.

    Note: My posts per page is set to 6.

    Rants! has 27 posts in it, and 2 sub-categories Comedy with 1 post and Experiences with 2 posts. This means the parent category (Rants!) has 30 posts and the side bar menu widget “Categories” correctly shows that number.

    However, get_the_category says it only has a count of 27

    More over, if you go to page 3 ( suddenly get_the_category is ALL wrong.. It delivers the information for the “Experiences” category, not the “Rants!” category.

    I’m NOT referencing it in the loop but its acting like I am.

    On page three of the category “Rants!” the first entry is one that is from “Experiences” so its likely an error around that.

    Do you agree or disagree this is a bug?

    Note; Previously “get_the_categories” had the same (and worse) bugs — its still not fixed.

Viewing 2 replies - 1 through 2 (of 2 total)
  • This tag must be used within the loop and returns an array of each category assigned to a post. I’m not sure that this tag is meant to do what you want, so why not try a different category tag?

    Okay then, I’m using it incorrectly.

    Which brings me to my next point.. (and I’m disabling the ?example stuff now)

    if you’re at this url;

    How do you get the correct category information OUTSIDE the loop? I mean it must be available.. the category slug is rants, it says so right there in the url… I want the rants category information to be available to me outside the loop..

    Am I forced to write my own call here?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘get_the_category() is STILL broken…’ is closed to new replies.