Custom menus created but does not show up in admin panel

I don’t think you need to initiate the menus again where register_nav_menus() itself is an initiator. Syntax: <?php register_nav_menu( ‘your-menu-handle’, ‘Your Menu Label’ ); ?> Copy the following code and Paste them into your functions.php without any function or add_action(), I hope it’ll work: register_nav_menus( array( ‘front_login_menu’ => __( ‘Front Login Menu location’), ‘top_front_general_menu’ => … Read more

html/bootstrap menu to wordpress with dropdown

Try this walker. Example usage: wp_nav_menu( [ ‘menu_class’ => ‘menu-horizontal text-left’, ‘container’ => ”, ‘depth’ => 2, ‘theme_location’ => ‘main-menu’, // You should have loaded the class-my-bs-walker-nav-menu.php file from // within the theme’s functions.php file. ‘walker’ => new My_BS_Walker_Nav_Menu, ] ); The walker is not intended as a “global” walker for any Bootstrap menus; instead, … Read more

show only a given level in nav menu

You need to extend Walker_Nav_Menu in such a way that it only outputs, if I understand you, items that are not “zero” depth– top level. class my_extended_walker extends Walker_Nav_Menu { function start_lvl(&$output, $depth, $args ) { if (0 !== $depth) { parent::start_lvl($output, $depth, $args); } } function end_lvl(&$output, $depth, $args) { if (0 !== $depth) … Read more

rename navigation menu label in wordpress theme by code

Maybe try filtering just the menu items you want when they get printed back on the front end. You can do that in functions.php Here you can filter the HTML list content for navigation menus. https://developer.wordpress.org/reference/hooks/wp_nav_menu_items/ After some talk, give this a try and then call your lo() where you need it: function lo() { … Read more

Get parent page/menu id of current post

I believe you want get_queried_object. If you have set your static front page and blog page from wp-admin->Settings->Reading then get_queried_object will give you information about the page you chose rather than about the posts in the Loop. Be aware that get_queried_object will return very different types of information depending on the kind of page you … Read more