[wp-testers] why in_category() work in page template

Stephen Rider wp-hackers at striderweb.com
Fri Apr 4 17:32:26 GMT 2008


On Apr 3, 2008, at 9:40 AM, Stefano Aglietti wrote:
> Every page got the default category in the tazonomy table and this is
> something I consider wrong, cause if pages has not categories
> theydon't have to have a category associated (even if it's the default
> one)
>
> But someone on italian forum asked me about how to manypoulate the
> database directly to change the category for some pages cause he's
> using the tag in_category() in default page.php tempaltes and other
> pag templates and it works.
>
> It's not a bug? This tag shouldn't work at all or replay alway true or
> false if is used in a page template.
>
> What's your idea before i open a ticket on trac?

Sounds like a bug to me.  In the meantime, you might use something like:

in_category() && is_post()



More information about the wp-testers mailing list