UberMenu integrates easily with Libra, but there is some significant residual styling because the menu styles are based on the #nav ID, which is not set via wp_nav_menu. All we need to do is change the id=”nav” to id=”nav-uber”, but since the menu is not printed directly in the header.php, we can’t use the normal WordPress template system to just override the header template. Instead, we can use Libra’s template system to provide our own replacement nav template. Here’s what needs to be done:
- Create a child theme for Libra
- Create our own topbar.php template which will replace the default Libra template. This template will contain a single modification – change
id="nav"
toid="nav-uber"
- Override the pluggable
yit_topbar()
function so we can replace the template with our own. Add this code to the child theme’s functions.php:function yit_topbar() { require_once( 'topbar.php' ); }
- Activate the child theme and set a menu in the theme location in Appearance > Menus
I’ve created a child theme that does all of this for you. Just install and activate it, then set up your menu as usual.