Guest User

Variation to pcwriter pastebin http://pastebin.com/8FJmcgRF (hnla)

a guest
Aug 3rd, 2010
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.47 KB | None | 0 0
  1. // Register nav menus in bp-custom.php
  2. <?php
  3. if ( function_exists( 'register_nav_menus' ) ) {
  4. register_nav_menus( array(
  5. 'bp_adminbar_user1' => __( 'Adminbar links 1'),
  6. 'bp_adminbar_user2' => __( 'Adminbar links 2')
  7. ) );
  8. }
  9. for flexibility? two menus registered
  10.  
  11. ?>
  12.  
  13. // Begin pcwriter's 'pages' function
  14.  
  15. <?php
  16.  
  17. function pages(){
  18. ?>
  19.  
  20. <ul><!-- Community Drop Down -->
  21. <li
  22. <?php if (bp_is_page( BP_ACTIVITY_SLUG ) ||
  23. bp_is_page( BP_MEMBERS_SLUG ) || bp_is_member() ||
  24. bp_is_page( BP_GROUPS_SLUG ) || bp_is_group() ||
  25. bp_is_page( BP_FORUMS_SLUG ) ||
  26. bp_is_page( BP_BLOGS_SLUG ) ) : ?> class="selected"<?php endif; ?>>
  27.  
  28. <a href="<?php echo site_url() ?>/<?php echo BP_ACTIVITY_SLUG ?>/" title="<?php _e( '', 'buddypress' ) ?>"><?php _e( 'Community', 'buddypress' ) ?></a>
  29. <ul>
  30.  
  31. <?php if ( 'activity' != bp_dtheme_page_on_front() && bp_is_active( 'activity' ) ) : ?>
  32. <li<?php if ( bp_is_page( BP_ACTIVITY_SLUG ) ) : ?> class="selected"<?php endif; ?>>
  33. <a href="<?php echo site_url() ?>/<?php echo BP_ACTIVITY_SLUG ?>/" title="<?php _e( 'Activity', 'buddypress' ) ?>"><?php _e( 'Activity', 'buddypress' ) ?></a>
  34. </li>
  35. <?php endif; ?>
  36.  
  37. <li<?php if ( bp_is_page( BP_MEMBERS_SLUG ) || bp_is_member() ) : ?> class="selected"<?php endif; ?>>
  38. <a href="<?php echo site_url() ?>/<?php echo BP_MEMBERS_SLUG ?>/" title="<?php _e( 'Members', 'buddypress' ) ?>"><?php _e( 'Members', 'buddypress' ) ?></a>
  39. </li>
  40.  
  41. <?php if ( bp_is_active( 'blogs' ) && bp_core_is_multisite() ) : ?>
  42. <li<?php if ( bp_is_page( BP_BLOGS_SLUG ) ) : ?> class="selected"<?php endif; ?>>
  43. <a href="<?php echo site_url() ?>/<?php echo BP_BLOGS_SLUG ?>/" title="<?php _e( 'Member Blogs', 'buddypress' ) ?>"><?php _e( 'Member Blogs', 'buddypress' ) ?></a>
  44. </li>
  45. <?php endif; ?>
  46.  
  47. <?php if ( bp_is_active( 'groups' ) ) : ?>
  48. <li<?php if ( bp_is_page( BP_GROUPS_SLUG ) || bp_is_group() ) : ?> class="selected"<?php endif; ?>>
  49. <a href="<?php echo site_url() ?>/<?php echo BP_GROUPS_SLUG ?>/" title="<?php _e( 'Groups', 'buddypress' ) ?>"><?php _e( 'Groups', 'buddypress' ) ?></a>
  50. </li>
  51.  
  52. <?php if ( bp_is_active( 'forums' ) && bp_is_active( 'groups' ) && ( function_exists( 'bp_forums_is_installed_correctly' ) && !(int) get_site_option( 'bp-disable-forum-directory' ) ) && bp_forums_is_installed_correctly() ) : ?>
  53. <li<?php if ( bp_is_page( BP_FORUMS_SLUG ) ) : ?> class="selected"<?php endif; ?>>
  54. <a href="<?php echo site_url() ?>/<?php echo BP_FORUMS_SLUG ?>/" title="<?php _e( 'Group Forums', 'buddypress' ) ?>"><?php _e( 'Group Forums', 'buddypress' ) ?></a>
  55. </li>
  56. <?php endif; ?>
  57. <?php endif; ?>
  58.  
  59. <?php do_action( 'bp_nav_items' ); ?><!-- Add BP- Plugin Directories to Community Drop Down -->
  60. </ul>
  61. </li>
  62.  
  63. <li>
  64. <?php wp_list_pages( 'title_li=&depth=20&exclude=' . bp_dtheme_page_on_front() ); ?>
  65. </li>
  66. // Add call to nav menus
  67. <?php if(has_nav_menu('bp_adminbar_user1')): ?>
  68. <li><a href="<?php site_url() ?>">my links 1</a>
  69.  
  70. <?php wp_nav_menu(array('sort_column' => 'menu_order', 'container' => '', 'fallback_cb' => '', 'theme_location' => 'bp_adminbar_user1')) ?>
  71.  
  72. </li>
  73. <?php endif; ?>
  74.  
  75. <?php if(has_nav_menu('bp_adminbar_user2')): ?>
  76. <li><a href="<?php site_url() ?>">my links 2</a>
  77.  
  78. <?php wp_nav_menu(array('sort_column' => 'menu_order', 'container' => '', 'fallback_cb' => '', 'theme_location' => 'bp_adminbar_user2')) ?>
  79.  
  80. </li>
  81. <?php endif; ?>
  82. // end additions to original script
  83. </ul>
  84.  
  85.  
  86. <?php
  87. }
  88. add_action( 'bp_adminbar_menus', 'pages', 15 );
  89.  
  90.  
  91.  
  92. ?>
Add Comment
Please, Sign In to add comment