In this post,I will show you the quickest way to add menu items to a buddypress site,sitewide.
As you may be knowing,buddypress-wpmu powered sites need at least two themes,one for the site home page and one for the members profile,group etc(called member theme usually).So,when you want to add more menu items to the top navigation, you have two options.
1.Add the menu links to each of the theme(yes, you will have to add the link in the home theme and the buddypress member theme separately).
2.Simply write a small snippet of code and upload it to mu-plugins directory.It will add the link globally.
Well,let us start with the basics,I will take an example of the buddypress default home theme and buddypress default member theme.
Here is what you get as the top nav,when you install buddypress and activate the default themes

Well,so suppose now you want to add a few links(menu items) in the top navigation.As I mentioned, you have two options.
Option 1:-Go and edit the nav (for default theme,It is in header.php, look into your theme for the location of the menu) in the Buddypress Home theme and buddypress member theme.You are done.But suppose, you have to add/remove some links later ,you will have to again edit both the theme.
Well ,I have a shortcut for you.
Option 2:
Buddypress default theme(or any of the well coded buddypress theme) , provides an action hook “bp_nav_items” ,we can use this action hook to hook our new links into the menu.
Well,again we have two choices now.We can either use the functions.php of each of the theme(Home and member and add our function to add links),but again,this causes redundancy.
So,the better option is , let us define the functions in a new file say my-extra-links.php(you may name it what ever you like) and define the action function there as
<?php //add the action hook add_action("bp_nav_items","extra_nav_links"); //insert the links now function extra_nav_links() { ?> <li><a href="#">My Link 1</a><li> <li><a href="#">My Link 2</a></li> <?php } ?>
Relace the hash(#) with the url of your link,and you are done.ahh ,yes, we have yet to upload the file somewhere.Since,In wordpress Mu,the files(or let us say properly ,the plugins) kept in the wp-content/mu-plugins directory gets automatically activated sitewide,we will use this functionality and upload our file to the mu-plugins directory.
Once, you are done with the uploading of the file to the mu-plugins directory, refresh your site page in the browser ,and you will see something like this

Why you should use this approach:-It will allow you to keep your extra menu items ,even if the themes for buddypress gets changed(the only requirement is the new themes should also be using the action hook “bp_nav_items“).Well,I think, this approach, may reduces a couple of minutes in your development time.
So,what do you think? which approach is better? looking forward to your thoughts on it.

![[blinklist]](http://www.thinkinginwordpress.com/wp-content/plugins/bookmarkify/blinklist.png)
![[Bloglines]](http://www.thinkinginwordpress.com/wp-content/plugins/bookmarkify/bloglines.png)
![[del.icio.us]](http://www.thinkinginwordpress.com/wp-content/plugins/bookmarkify/delicious.png)
![[Digg]](http://www.thinkinginwordpress.com/wp-content/plugins/bookmarkify/digg.png)
![[dzone]](http://www.thinkinginwordpress.com/wp-content/plugins/bookmarkify/dzone.png)
![[Facebook]](http://www.thinkinginwordpress.com/wp-content/plugins/bookmarkify/facebook.png)
![[Ma.gnolia]](http://www.thinkinginwordpress.com/wp-content/plugins/bookmarkify/magnolia.png)
![[Mister Wong]](http://www.thinkinginwordpress.com/wp-content/plugins/bookmarkify/misterwong.png)
![[Reddit]](http://www.thinkinginwordpress.com/wp-content/plugins/bookmarkify/reddit.png)
![[Sphere]](http://www.thinkinginwordpress.com/wp-content/plugins/bookmarkify/sphere.png)
![[Sphinn]](http://www.thinkinginwordpress.com/wp-content/plugins/bookmarkify/sphinn.png)
![[StumbleUpon]](http://www.thinkinginwordpress.com/wp-content/plugins/bookmarkify/stumbleupon.png)
![[Technorati]](http://www.thinkinginwordpress.com/wp-content/plugins/bookmarkify/technorati.png)
![[Email]](http://www.thinkinginwordpress.com/wp-content/plugins/bookmarkify/email.png)




