WordPress Custom Menus Issue
Are you sure you have created that menu and associated it with with “secondary” menu location? Just asking…
Are you sure you have created that menu and associated it with with “secondary” menu location? Just asking…
This is another case where a pure-CSS definition will work. For example: #main_nav_left li:after { content: ‘ | ‘; } #main_nav_left li:last-child:after { content: ”; }
function my_page_menu_args( $args ) { if($args[‘theme_location’] === ‘primary’) $args[‘show_home’] = true; return $args; } add_filter( ‘wp_page_menu_args’, ‘my_page_menu_args’ ); The $args array also contains the theme location, so you can filter on that.
Goto Appearance -> Menus You can see all categories listed here including wp-ecommerce categories. Just create a new menu for your wp-ecommerce categories. Lets call it “ecomcategories”. You can call this menu in your theme using this code. <?php wp_nav_menu( array(‘menu’ => ‘ecomcategories’ )); ?> You can just drag and drop for sub menus. You … Read more
This can be done easily with CSS. I would use the default wp_nav_menu() function to do the heavy lifting for you and build your menus under Appearance->Menus. If you click on screen options there is a checkbox under advanced menu properties called CSS Classes. Check that box. When you add a new menu item, you … Read more
Use wp_get_nav_menu_items to iterate through the menu items, modifying the one that you want to in the loop. See the example code here for more information.
There’s a site option for page_for_posts, so you might try if ( is_page( get_option(‘page_for_posts’) ) ). Edit: According to the Codex, is_home() will tell you if you’re on the blog page when you have a static front page: http://codex.wordpress.org/Conditional_Tags#The_Main_Page. I can’t test it right at this moment, but if that’s true, then that must be … Read more
You need to target the appropriate theme_location. Assuming you’ve defined multiple nav menu locations using register_nav_menus() in functions.php: <?php register_nav_menus( array( ‘primary-menu’ => ‘Primary Menu’, ‘secondary-menu’ => ‘Secondary Menu’ ) ); ?> Then you call wp_nav_menu() using the appropriate theme_location as defined above, along with any other relevant arguments, e.g.: <?php wp_nav_menu( array( ‘theme_location’ => … Read more
Unfortunately there is no filter which can overcome this issue. You have to override the start_el function of the walker. Here is the original source: $class_names = join( ‘ ‘, apply_filters( ‘nav_menu_css_class’, array_filter( $classes ), $item, $args ) ); $class_names=” class=”” . esc_attr( $class_names ) . ‘”‘; $id = apply_filters( ‘nav_menu_item_id’, ‘menu-item-‘. $item->ID, $item, $args … Read more
I think this should work if you are wrapping the condition around the arguments, and not the menu link itself: if(!is_user_logged_in()) { $args = array( ‘exclude’ => ‘100,110,145’ ); } else { $args = array( ‘exclude’ => ‘100,145’ ); } wp_list_pages( $args );