Navigation Bar – Activated State
-
hey im having a navigation bar whose ul class should be the current category or page so the navigation button of the current page or category is highlighted.
it works just fine with categories. but i have two static pages called “wir” and “arbeit”. when i’m on the page Arbeit, the ul class should be “Arbeit”, but it won’t work. any ideas why?
<?php if (is_page('Arbeit')) { ?> <ul id="nav" class="Arbeit"> <?php } elseif (is_page('Wir')) { ?> <ul id="nav" class="Wir"> <?php } elseif (is_category()) { // Load active navigation status for categories and posts?> <ul id="nav" class="<?php foreach((get_the_category()) as $category) {echo $category->cat_name . ' ';} ?>"> <?php } ?> <li id="home"><a href="<?php echo get_settings('home'); ?>"></a></li> <li id="wir"><a href="/wir"></a></li> <li id="arbeit"><a href="/arbeit"></a></li> <li id="news"><a href="/category/news"></a></li> <li id="inspiration"><a href="/category/inspiration"></a></li> </ul>
- The topic ‘Navigation Bar – Activated State’ is closed to new replies.