HTML TO WP Theme : Submenu goes down wp_nav_menu
HTML TO WP Theme : Submenu goes down wp_nav_menu
HTML TO WP Theme : Submenu goes down wp_nav_menu
Actually I think you need to hide or show the menu items based on “User Role”. So here a possible solution would be creating menus for each roles and showing them by condition based on “User Role”. Here is the code- function the_dramatist_menu_change( $args=”” ) { $current_user = wp_get_current_user(); if( in_array(‘your-user-role’, $current_user->roles) ) { $args[‘menu’] … Read more
What you have is a theme location, you need to first get the menu assigned to that location to get its items: if( ( $locations = get_nav_menu_locations() ) && isset( $locations[ ‘omahamenu’ ] ) ) { $menuooo = wp_get_nav_menu_items( $locations[‘omahamenu’] ); var_dump( $menuooo ); }
You can filter menu items with the wp_nav_menu hook
Thanks to help from @Milo, I was able to figure it out. It had to do with the ‘theme_location’ => ‘main_nav_primary’ line in the wp_nav_menu function call in the header. In functions.php, the primary menu was just registered as primary so I had to change the function call to ‘theme_location’ => ‘primary’. I find it … Read more
I think your scope is not the same. You are defining the $menu_name in one scope and calling it in another scope. So you can do it with global variable like below- $GLOBALS[ ‘menu_name’ ] = ‘Section 1 Menu’; And call it like- <div id=”nav”> <div class=”close-menu”></div> <?php wp_nav_menu( array( ‘menu’ => $GLOBALS[ ‘menu_name’ ], … Read more
There’s nothing wrong with your theme_setup() function in your functions.php file. The error you get simply points out the fact that the menu name Main Menu already exists. In other to resolve this you should replace your Main Menu menu name definitions in your functions.php file with something other than what it currently is. It’s … Read more
It is a conflict between your theme’s css and the admin header. Options are to modify your theme’s css, or remove the admin bar. To remove your admin bar add this to your theme’s functions.php file: add_filter(‘show_admin_bar’, ‘__return_false’);
Use Appearance, Menus in the Admin area to add menu items; create a menu first if not already there. Then assign the menu to the site via the Manage Locations tab on the same screen. Depending on the theme you use, you’ll be able to assign your menu so it appears where allowed by the … Read more
In your theme file place below code there where you need. <?php wp_nav_menu( array( ‘theme_location’ => ‘side’ ) ); ?> https://codex.wordpress.org/Navigation_Menus#Display_Menus_on_Theme