• Hello everyone.
    I have the fowlloing code on my sidebar:

    <?php
    if (is_home())
    {?>
    some script here
    <?}
    elseif (in_category('369'))
    {?>
    some script here
    <?}
    
    else
    { ?>
    some script here
    <?}
    ?>

    For some reason in_category won’t work. But if i change it to is_category then i see the script working on the category page .
    Any thoughts?

Viewing 1 replies (of 1 total)
  • Take a look at the codex. in_category usually runs in The Loop and the sidebar isn’t in The Loop. is_category is a conditional tag which generally is placed outside The Loop.

Viewing 1 replies (of 1 total)
  • The topic ‘in_category not working’ is closed to new replies.