Trouble with deprecated get_the_category
-
Just upgraded to 1.5 and everything has gone fine so far except for one little problem.
I have been changing the width of a div depending on the id number of the current post. Under 1.2, I used this:
<?php foreach(get_the_category() as $cat){}; ?>
to get the ID number, and then performed a simple If:
if ($single) {
if ($cat->category_id == 26) {to branch accordingly. With get_the_category deprecated, I’m stumped as to how to replicate this functionality. The codex listed a block of code that was supposed to work as a substitute, but it generates an error when I try to use it. Please help!
Thanks
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Trouble with deprecated get_the_category’ is closed to new replies.