• I have standard conditional statements to create “active” states for the nav here:

    https://www.foxhoundstudio.com/clients/marco/

    As you can see, both “Home” AND “Members Area” are both “active” right now. For some reason, the home page thinks it is in_category(14) … and I can’t figure out why.

    I currently have cat 14 as a parent category like this:
    (14) Members Area
    (15)- sub cat
    (##)– sub sub cat
    (20)- sub cat
    (##)– sub sub cat

    using in_category(##) for any of the above categories, makes the home page thinks it is in that category (but it’s not even a category page … wtf ?) I tried using in_category(13) and it was fine.

    I tried stripping EVERYTHING out, literally so that the page had no header, no footer, and the index.php simply said “if in_category(14)” and it was still showing up.

    My code looks like this:

    <li<?php global $post; if ( is_home() ) { echo ' class="active"'; } ?>><a href="<?php bloginfo('home'); ?>">Home</a></li>
    <li<?php global $post; if ( is_page('services') ) { echo ' class="active"'; } ?>><a href="<?php bloginfo('home'); ?>/services">Services</a></li>
    <li<?php global $post; if ( in_category(14) || is_page('members') ) { echo ' class="active"'; } ?> id="nav-members">

    I tested functions.php by deleting it … that’s not the problem.
    I tested all plugins by deactivating all of them … they are not the problem.
    I tested “is_page(‘members’)” by removing it … it is not the problem (it is definitely “in_category(14)”

    Can anyone maybe shed some light on this?

Viewing 1 replies (of 1 total)
  • Thread Starter supervee

    (@supervee)

    * bump

    in the mean time, I was able to work around this by creating a Page, giving it a template, and telling the site to use this page as a static front page.

Viewing 1 replies (of 1 total)
  • The topic ‘Problem with Conditional Tag’ is closed to new replies.