wordpress / php help

Out of context: Reply #23

  • Started
  • Last post
  • 30 Responses
  • dbloc0

    I've got another problem I'm trying to figure out.

    I am setting $currentSec = "events"; at the top of the page template before the header loads.

    I want to use this to light up the nav in header

    <?php if(is_page('events') || is_single() && in_category('events') || $currentSec == 'events'){ echo ' class="active"'; } ?>

    the variable doesn't seem to be working on the template page that I set the variable on

    (probably another bad explanation)

View thread