register_nav_menus() won’t register menus

You don’t need to add any action to register your Nav Menu. Here are some quick steps for you to get your WordPress Nav Menu to work… Register Nav Menu if (function_exists(‘register_nav_menu’)) { register_nav_menu(‘header_menu’, ‘Header Menu’); } Define and Use Nav Menu in your Theme: Usually we place the Menu DIV code in header.php file; … Read more

How to create different navigation for registered users in WooThemes Canvas?

add_action(‘init’,’wpsites_members_menu’); function wpsites_members_menu(){ if(is_user_logged_in()){ add_filter( ‘wp_nav_menu_args’ , ‘logged_in_nav_menu’ ); } } Display Different Nav Menu For Logged in and Logged Out Users Source: http://wpsites.net/web-design/members-nav-menu-logged-in-members/ function logged_in_nav_menu( $args ) { if ( $args[‘theme_location’] == ‘primary’ ) { $args[‘menu’] = ‘members’; } return $args; }

Different menu navigation per category

Try the following <nav id=”site-navigation” class=”main-navigation” role=”navigation”> <h3 class=”menu-toggle”><?php _e( ‘Menu’, ‘twentytwelve’ ); ?></h3> <a class=”assistive-text” href=”#content” title=”<?php esc_attr_e( ‘Skip to content’, ‘twentytwelve’ ); ?>”><?php _e( ‘Skip to content’, ‘twentytwelve’ ); ?></a> <?php //Replace it with the id/slug/name(anything you want) if( is_category( ‘Talkative’ ) ) { wp_nav_menu( array( ‘theme_location’ => ‘primary’, ‘menu_class’ => ‘nav-menu’, ‘menu’ … Read more

How to add class to parent a tag with a sub menu

You can simply add this code snippet in your theme’s functions.php file. /* Add classes and other attributes to the anchor tags if list item is a parent */ add_filter( ‘nav_menu_link_attributes’, ‘add_class_to_items_link’, 10, 3 ); function add_class_to_items_link( $atts, $item, $args ) { // check if the item has children $hasChildren = (in_array(‘menu-item-has-children’, $item->classes)); if ($hasChildren) … Read more