Tag Info

Hot answers tagged

2

Try this link may helpful http://codex.wordpress.org/Function_Reference/wp_create_nav_menu // Check if the menu exists $menu_exists = wp_get_nav_menu_object( $menu_name ); // If it doesn't exist, let's create it. if( !$menu_exists){ $menu_id = wp_create_nav_menu($menu_name); // Set up default menu items wp_update_nav_menu_item($menu_id, 0, ...


1

This can be achieved many ways. But, the below method is most prominent to me. add_filter('the_title', 'wpse165333_the_title', 10, 2); function wpse165333_the_title($title, $post_ID) { if( 'nav_menu_item' == get_post_type($post_ID) ) { if( 'taxonomy' == get_post_meta($post_ID, '_menu_item_type', true) && 'category' == ...


1

Can't you change CSS rules? .hide-item-not-login{ display: block !important; } .logged-in .hide-item-not-login{ display: none !important; } EDIT To add login/logout menu item, you will need to add one more class to logout menu item. Let's say you added class .logout-link to logout menu item. Then you can add css like this. .hide-item-not-login{ ...


1

This can be done by having the display: none; only on the .logged-in selector. Like this... .logged-in .hide-item-not-login { display: none; } You might want to change that .hide-item-not-login to a more accurate .hide-item-login or something to make it more clear for this changed use case. Though it makes no difference to the functionality of it.


1

You already mentioned in your question that u had removed li from the menu. so may be this will work. in this walker u can give the class in the Appearance ->menu css options (On the top right of the screen click on 'Screen Options' on the bottom row - make sure 'CSS Classes' is checked.) class Class_Name_Walker extends Walker_Nav_Menu { /** ...


1

i tried the below code and it worked. add this to your functions.php register_nav_menus(array( 'top-menu' => __('Menu1', 'twentyfourteen'), 'side-menu' => __('Menu2', 'twentyfourteen'), 'footer-menu' => __('Menu3', 'twentyfourteen') ) ); function my_walker_nav_menu_start_el($item_output, $item, $depth, $args) { $menu_locations = ...


1

You can create menus using register_nav_menus() Using the example in the above link, you world simply add the following to your themes functions.php file register_nav_menus( array( 'pluginbuddy_mobile' => 'PluginBuddy Mobile Navigation Menu', 'footer_menu' => 'My Custom Footer Menu', ) );



Only top voted, non community-wiki answers of a minimum length are eligible