Topic: Tutrial / Navbar wp_nav_menu() is wrong?
gorokuma1963
pro
asked 6 years ago
Tutrial stated...
<?php
if ( has_nav_menu( 'navbar' ) ) {
wp_nav_menu( array(
'menu' => 'navbar',
'theme_location' => 'navbar',
'depth' => 2,
'menu_class' => 'nav navbar-nav',
'fallback_cb' => 'wp_bootstrap_navwalker::fallback',
'walker' => new MDBBootstrapNavMenuWalker())
);
} else
echo "Please assign Navbar Menu in Wordpress Admin -> Appearance -> Menus -> Manage Locations";
?>
should be ?
<?php
if ( has_nav_menu( 'navbar' ) ) {
wp_nav_menu( array(
'menu' => 'navbar',
'container' => '',
'theme_location' => 'navbar',
'depth' => 2,
'menu_id' => '',
'menu_class' => 'navbar-nav mr-auto',
'fallback_cb' => 'wp_bootstrap_navwalker::fallback',
'walker' => new MDBBootstrapNavMenuWalker())
);
} else
echo "Please assign Navbar Menu in Wordpress Admin -> Appearance -> Menus -> Manage Locations";
?>
otherwise
Search form not showing properly?
Add comment
Alan Mroczek
free
answered 6 years ago
Hi Gorokuma1963.
If you want to have search form in navbar you can use this: http://pastebin.com/zMmu0JEq
I tried your solution, but it didn't worked for me, maybe you are using other version of
MDB and Bootstrap (I used 4.0.0 FREE, this version is used in our Wordpress tutorial).
If you are intrested in material design on Wordpress platform, you can try also our theme
for Wordpress based on MDB: Material Design for Wordpress (mdwp.io).
Regards, Alan.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Status
Specification of the issue
- User: Pro
- Premium support: No
- Technology: General Bootstrap questions
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No
Tags