[wp-hackers] in_category() and Pages

Andrew Nacin wp at andrewnacin.com
Wed Dec 15 05:32:19 UTC 2010

On Tue, Dec 14, 2010 at 5:56 PM, Sergey Biryukov <sergeybiryukov.ru@
gmail.com> wrote:

> I've noticed that in_category(1) returns true for some pages (i.e.
> About) both in WordPress 3.0.3 and 3.1-beta1-16884 with Twenty Ten
> theme and no plugins.
> For some other pages it returns false. I haven't figured out the
> pattern yet. is_single() && in_category(1) works fine.
> I supposed that it should only return true for posts in the specified
> category. Is this a bug or intended behaviour?

Can't reproduce. Pages don't have categories and therefore in_category(
$name_slug_or_id ) should always return false.

Please try the wp-testers list in the future.

If you can debug why this is happening, that'd be great.


More information about the wp-hackers mailing list