• Resolved matthisco

    (@matthisco)


    I’m trying to use a basic statment in my menu to change the selected state of my menu. The last ‘if’ statement works fine, the others are always ‘on’ can anyone please tell me why?

    <?php if ( is_page(our-mission)){echo "nav-active";} ?>
    <?php if ( is_page(vision-values)){echo "nav-active";} ?>"
    <?php if ( is_page(our-board)){echo "nav-active";} ?>"
    <?php if ( is_page(latest-news)){echo "nav-active";}  ?>"
    <?php if ( is_page('have-your-say')){echo "nav-active";}  ?>"
    <?php if ( is_page(contact)){echo "nav-active";}  ?>">

    I’ve used similar code on other sites and it works fine. Could my browser be caching the page state that keeps echoing the nav-active?

    Many thanks

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘function is_page – state always on -help?’ is closed to new replies.