What is wrong with this conditional statement?

Hi I am trying to have the navigation highlights determined by what category or page you are looking at using wordpress. Can someone tell me what is wrong with a statement like this:

<?php if (in_category('b')){ ?>
    <ul>
        <li><a href="#">A</a></li>
        <li><a class="current" href="#">B</li>
    </ul>
<?php } else { ?>
    <ul>
        <li><a class="current" href="#">A</a></li>
        <li><a href="#">B</li>
    </ul>
<?php } ?>

I am trying to use something like this but my else statement is ignored and the ‘b’ is always current regardless of category.

Related posts

Leave a Reply

2 comments