Main Navigation help
-
I’m getting to the end of development and one of the things that has been a constant issue is that I’ve got the following code :
<ul id="nav">
<li<?php if ( bp_is_page( 'home' ) ) : ?> class="selected"<?php endif; ?>>
<a href="<?php echo get_option('home') ?>" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php _e( '// Home', 'buddypress' ) ?></a>
</li>
<li<?php if ( bp_is_page( BP_HOME_BLOG_SLUG ) ) {?> class="selected"<?php } ?>><a href="<?php echo get_option('home') ?>/<?php echo BP_HOME_BLOG_SLUG ?>" title="<?php _e( 'News', 'buddypress' ) ?>"><?php _e( '// News', 'buddypress' ) ?></a></li>
<li<?php if ( is_page('local-networks') ) {?> class="selected"<?php } ?>><a href="<?php bloginfo('url'); ?>/local-networks" title="<?php _e( 'Local Networks', 'buddypress' ) ?>"><?php _e( '// Local Networks', 'buddypress' ) ?></a></li>
<?php if ( function_exists( 'groups_install' ) ) { ?>
<li<?php if ( bp_is_page( BP_GROUPS_SLUG ) ) {?> class="selected"<?php } ?>><a href="<?php echo get_option('home') ?>/<?php echo BP_GROUPS_SLUG ?>" title="<?php _e( 'Groups', 'buddypress' ) ?>"><?php _e( '// Groups', 'buddypress' ) ?></a></li>
<?php } ?>
<li <?php if ( bp_is_page( BP_MEMBERS_SLUG ) ) {?> class="selected"<?php } ?>><a href="<?php echo get_option('home') ?>/<?php echo BP_MEMBERS_SLUG ?>" title="<?php _e( 'Members', 'buddypress' ) ?>"><?php _e( '// Members', 'buddypress' ) ?></a></li>
<?php if ( function_exists( 'bp_blogs_install' ) ) { ?>
<li<?php if ( bp_is_page( BP_BLOGS_SLUG ) ) {?> class="selected"<?php } ?>><a href="<?php echo get_option('home') ?>/<?php echo BP_BLOGS_SLUG ?>" title="<?php _e( 'Blogs', 'buddypress' ) ?>"><?php _e( '// Blogs', 'buddypress' ) ?></a></li>
<?php } ?>
<li><a href="<?php echo get_option('home') ?>/forums" title="<?php _e( 'Forums', 'buddypress' ) ?>"><?php _e( '// Forums', 'buddypress' ) ?></a></li>
<li<?php if (is_page('services') ) {?> class="selected"<?php } ?>><a href="<?php bloginfo('url'); ?>/services" title="<?php _e( 'Services', 'buddypress' ) ?>"><?php _e( '// Services', 'buddypress' ) ?></a></li>
<?php do_action( 'bp_nav_items' ); ?>
</ul>As you can see I’ve got a members page, problem is if I go to the services or the local networks page, the members is highlighted too, Any ideas why this would do that, as Im pretty sure the logic is right?
Cheers
Chris
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Main Navigation help’ is closed to new replies.