Switch an entire nav menu if user is logged in

There are a couple of issues with the original code. In the if statement, $args[‘menu’] is being set to Non-Members Area (which will then evaluate to true). It looks like you actually want to be doing an equality check there. A good way to avoid this is to use Yoda conditions. Also, the $args array …

Read more

Need a menu on left sidebar of the page with below requirements [closed]

Use a tutorial made for wordpress linke this one -> http://mysitemyway.com/docs/Collapsible_sidebar_menus and use a jQuery for animation jQuery(document).ready(function(){ jQuery(‘.menu .dropdown a’).click(function(e){ e.preventDefault(); if (jQuery(this).parent().children(‘.sub-menu:first’).is(‘:visible’)) { jQuery(this).parent().children(‘.sub-menu:first’).hide(); } else { jQuery(this).parent().children(‘.sub-menu:first’).show(); } }); });

How to customize the built in menu in wordpress?

Try this plugin and this plugin will allow you to add a menu icon for menus. https://wordpress.org/plugins/menu-icons You can also use https://codex.wordpress.org/Function_Reference/register_nav_menu to create a custom menu and for displaying menu in your theme you can use https://developer.wordpress.org/reference/functions/wp_nav_menu/

Hide pages from the main menu

Instead of writing custom styles like .menu-item-346 where you are hardcoding some styles… why not just add a custom css class with the editor under Appearance -> Menus. WordPress has this build in. Under Appearance -> Menus you need to open the Screen Options and tick the box CSS Classes. After this you can now …

Read more

Hide an item from a menu to some users

Pls use filter wp_nav_menu_{$menu->slug}_items for conditionally adding or removing the menu-items. https://developer.wordpress.org/reference/hooks/wp_nav_menu_menu-slug_items/ See Method 2 at: https://wordpress.stackexchange.com/a/31753/116231

Twenty Fifteen: Change navigation menu behavior

In case anyone is interested, I think I managed to find a solution. Just had to add the following two lines of code just after the e.preventDefault(); line and before the _this.toggleClass( ‘toggle-on’ ); one: container.find( ‘.dropdown-toggle.toggle-on’ ).not( _this ).not( _this.parents( ‘.children, .sub-menu’ ).prev( ‘.dropdown-toggle’ ) ).removeClass( ‘toggle-on’ ).attr( ‘aria-expanded’, false ); container.find( ‘.children.toggled-on, .sub-menu.toggled-on’ …

Read more

Static site menu with multiple ul’s to wp menu

The html you give is standard WordPress behaviour, even including the wrapping <div>. Additionally you can pass parameters to wp_nav_menu to better suit your needs. The following should replicate your html: $args = array( ‘theme_location’ => ”, ‘menu’ => ”, ‘container’ => ‘div’, ‘container_class’ => ‘nav-menu’, ‘container_id’ => ”, ‘menu_class’ => ‘nav-container’, ‘menu_id’ => ”, …

Read more