Replies: 2 comments 10 replies
-
Yes, maybe that's not clear enough. Here is a step-by-step guide how to enable 3rd level depth nav-walker: Add new walker
// Register new 3 level depth nav-walker
function register_navwalker() {
require_once('inc/class-bootstrap-5-navwalker.php');
// Register Menus
register_nav_menu('main-menu', 'Main menu');
register_nav_menu('footer-menu', 'Footer menu');
}
<!-- Bootstrap 5 Nav Walker Main Menu -->
<?php
wp_nav_menu(array(
'theme_location' => 'main-menu',
'container' => false,
'menu_class' => '',
'fallback_cb' => '__return_false',
'items_wrap' => '<ul id="bootscore-navbar" class="navbar-nav ms-auto %2$s">%3$s</ul>',
'depth' => 2,
'walker' => new bootstrap_5_wp_nav_menu_walker()
));
?>
Demo: https://dev.bootscore.me, click the
// Close offcanvas on click a, keep .dropdown-menu open
$('.offcanvas a:not(.dropdown-toggle):not(a.remove_from_cart_button), a.dropdown-item').on('click', function () {
$('.offcanvas').offcanvas('hide');
});
// Close offcanvas on click a, keep .dropdown-menu open
$('.offcanvas a:not(.dropdown-toggle):not(a.remove_from_cart_button), a.dropdown-item:not(.dropdown-toggle)').on('click', function () {
$('.offcanvas').offcanvas('hide');
});
|
Beta Was this translation helpful? Give feedback.
-
I've now created a pull request containing your modifications. But it could perhaps be 'unusable' on your side because of two 'facts': 1.) I've created a pull request for main because I didn't know for which develop branch you want to get it. If I shall create the pull request for another branch, please tell me. 2.) I constantly replaced the content of the existing class-bootstrap-5-navwalker.php file by that of https://raw.githubusercontent.com/imanishpushkar/bs5-navwalker/master/navbar.php. The reason why I did that is, that your guideline for getting deeper menus could be reduce to Finally let me warrant you that I've successfully tested the content of this version with my site I am working on - with the same results I got yesterday by implementing your description manually. If you need further preliminary work on my side feel free to contact me. Best regards |
Beta Was this translation helpful? Give feedback.
-
I am very impressed how easy bootscore could replace my old theme. Now I am just trying to active 3 Level menus. I know, that there is an older discussion about this topic (#267), but the eventually offered solution does not work directly:
In the penultimate answer craftwerk answered "Simply add new nav-walker to your child and override function." For not getting 'there is general wordpress error' I had to add an inc directory into bootscore-child-main and copy the class-bootstrap-5-navwalker.php file into it. Then I could expand the function.php in bootscore-child-main by the lines, craftwerk had offered in his answer.
But this solution does not have any effect.
In the ultimate answer jonwebprocoder mentioned a complete solution offered by imanishpushkar . But for activating this solution I would have to modify header.php and navbar.php and a css. file.
Now my question: Do you have any step by step tutorial, how to activate the 3 Level menus successfully? If not, do you have any hint for me, how to solve my issue? (As giving back my first blog in my bootscore based blog will become the missed turorial ;-) )
Many thanks kreincke
Beta Was this translation helpful? Give feedback.
All reactions