BuddyPress – How to add logout in nav menu

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) { if(is_user_logged_in()) { $newitems=”<li><a title=”Logout” href=””. wp_logout_url(‘index.php’) .'”>Logout</a></li>’; $newitems .= $items; } else { $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); Source

How to get custom post type menu_name?

Hi @mike23: This code shows you how to get both singular and plural names (assuming you specified them as such in your register_post_type()). Note that the code example is presented as a standalone file you can save as test.php file in the root of your website and load in your browser with http://yoursite.com/test.php (assuming you … Read more

adding .current* tags to custom post types and taxonomies

The classes are not added by the Twenty Ten theme, but by the common custom navigation menu code, in _wp_menu_item_classes_by_context(), which is called from wp_nav_menu(). If you want to add extra classes you can do that by either hooking into wp_nav_menu_objects, called once with the whole menu tree, or into nav_menu_css_class, called when rendering each … Read more

Accesibility problems with dropdown menus in twentyten theme or others

This is a known issue with the Twenty Ten theme, arising from both the theme and core code. Twenty Ten has a number of accessibility issues – see Trac: http://core.trac.wordpress.org/ticket/14782 Some of these have been corrected in a child theme for Twenty Ten that you can get here: http://accessible.sprungmarker.de/2011/01/accessible-1-0/ The CSS and functions in the … Read more

How do I highlight the menu for a child page?

The archives.php template file is a custom page template file for a static Page. The is_archive() and is_home() conditionals apply to a blog posts archive and blog posts index, respectively.So, you’re never going to get is_archive() to return true while displaying the output of archives.php. To have your archives.php static Page appear in the menu: … Read more

Hide and show menu subpages

I think you’re asking how to make a menu with drop downs clickable rather than hoverable, so here’s a very simple example of what I think you want: http://jsfiddle.net/pk5Bx/ HTML <div id=”navigation”> <ul> <li class=”current_page_parent”><a href=”#”>Top level 1</a> <ul> <li><a href=”#”>Submenu 1</a></li> <li><a href=”#”>Submenu 2</a></li> </ul> </li> <li class=”current_page_parent”><a href=”#”>Top level 2</a> <ul> <li><a href=”#”>Submenu … Read more

How to get wordpress nav menu outside of wordpress system?

There are a few ways, here’s one: // no theme output define(‘WP_USE_THEMES’, false); // initializes the entire WordPress require ‘/path/to/your/wp/wp-blog-header.php’; // here you print your menu wp_nav_menu(‘your_theme_menu_location’); Even if theme output is disabled, the theme’s functions.php should still be loaded (and menu locations registered). You should cache the HTML somewhere within your script, because loading … Read more