Advertisement
Guest User

Logged In and Logged Out Navigation

a guest
Mar 2nd, 2013
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. Two files in your child theme need to be revised: header.php and functions.php
  2.  
  3. 1. header.php
  4.  
  5. Replace
  6. <?php wp_nav_menu( array( 'container' => false, 'menu_id' => 'nav', 'theme_location' => 'primary', 'fallback_cb' => 'bp_dtheme_main_nav' ) ); ?>
  7.  
  8. with
  9. <?php if ( is_user_logged_in() ) : ?>
  10. <?php wp_nav_menu( array( 'container' => false, 'menu_id' => 'nav', 'theme_location' => 'loggedin', 'fallback_cb' => 'bp_dtheme_main_nav' ) ); ?>
  11. <?php else : ?>
  12. <?php wp_nav_menu( array( 'container' => false, 'menu_id' => 'nav', 'theme_location' => 'primary', 'fallback_cb' => 'bp_dtheme_main_nav' ) ); ?>
  13. <?php endif; ?>
  14.  
  15. 2. functions.php
  16.  
  17. Replace
  18. // This theme uses wp_nav_menu() in one location.
  19. register_nav_menus( array(
  20. 'primary' => __( 'Primary Navigation', 'buddypress' ),
  21. ) );
  22.  
  23. with
  24. // This theme uses wp_nav_menu() in two locations.
  25. register_nav_menus( array(
  26. 'primary' => __( 'Primary Navigation', 'buddypress' ),
  27. ) );
  28. register_nav_menus( array(
  29. 'loggedin' => __( 'Logged In Users Navigation', 'buddypress' ),
  30. ) );
  31.  
  32. NOTE: You'd have to make a note of the changes you'll be making to the child theme because when you upgrade later on to a new version of Frisco, the revisions made above will be overwritten.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement