The ID (number) of the category the post belongs to.
How ever, it seems to always return 0, no matter what I do. I wanted to use it to check to see if the post is in one particular category (it will be the only category the post(s) will be in, so multi-cats aren’t an issue – I think) and if so, I want to change how some of the post meta info is displayed.
So what’s the deal? Does it not work, or is it left over legacy code from the single cat days?
Does anyone have any ideas on how to check the cat id of a post? If there are more than one, I know immediately that it isn’t in the special category, so that helps some, but I’d say that 80% of my posts are single cat posts, so that’s only going to work once in a while.
- The topic ‘Getting the post’s catID’ is closed to new replies.