WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to add a logout option to the main nav menu (not to the top bar) in BuddyPress?

share|improve this question
Are you using the supplied default theme? – ZaMoose Apr 17 '11 at 23:50
Yes, Im using the default theme. – José Pablo Orozco Marín Apr 18 '11 at 12:06
up vote 2 down vote accepted

Google is your friend. Here is a snippit I found I didn't test it but seems logical.

 // functions.php
function add_login_logout_link($items, $args)
    $newitems = '<li><a title="Logout" href="'. wp_logout_url('index.php') .'">Logout</a></li>';
    $newitems .= $items;
    $newitems = '<li><a title="Login" href="'. wp_login_url('index.php') .'">Login</a></li>';
    $newitems .= $items;
  return $newitems;
add_filter('wp_nav_menu_items', 'add_login_logout_link', 10, 2);


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.