Hi support,
Need help making ubermenu items inline, please.
Thanks
Hi support,
Need help making ubermenu items inline, please.
Thanks
Hello There,
Thanks for writing in!
I have resolved your issue.
I have removed this code:
.menu-item.x-menu-item.x-menu-item-search {
display: inline;
}
.menu-item.current-menu-parent.x-menu-item.x-menu-item-woocommerce {
display: inline;
}
And I added this code in your child theme’s functions.php file because there is a bug conflict between ubermenu and the search and cart menu items in the theme.
// Custom Navbar Cart menu when Ubermenu is active
// =============================================================================
function x_woocommerce_navbar_menu_item( $items, $args ) {
if ( X_WOOCOMMERCE_IS_ACTIVE && x_get_option( 'x_woocommerce_header_menu_enable' ) == '1' ) {
if ( $args->theme_location == 'primary' ) {
if ( ! class_exists( 'UberMenu' ) ) {
$items .= '<li class="menu-item current-menu-parent x-menu-item x-menu-item-woocommerce">'
. '<a href="' . x_get_cart_link() . '" class="x-btn-navbar-woocommerce">'
. x_woocommerce_navbar_cart()
. '</a>'
. '</li>';
} else {
$items .= '<li class="ubermenu-item ubermenu-item-level-0 menu-item current-menu-parent x-menu-item x-menu-item-woocommerce">'
. '<a href="' . x_get_cart_link() . '" class="ubermenu-target x-btn-navbar-woocommerce">'
. x_woocommerce_navbar_cart()
. '</a>'
. '</li>';
}
}
}
return $items;
}
add_filter( 'wp_nav_menu_items', 'x_woocommerce_navbar_menu_item', 9999, 2 );
// =============================================================================
// Custom Search Navigation when Ubermenu is active
// =============================================================================
function x_navbar_search_navigation_item( $items, $args ) {
if ( x_get_option( 'x_header_search_enable' ) == '1' ) {
if ( $args->theme_location == 'primary' ) {
if ( ! class_exists( 'UberMenu' ) ) {
$items .= '<li class="menu-item x-menu-item x-menu-item-search">'
. '<a href="#" class="x-btn-navbar-search">'
. '<span><i class="x-icon-search" data-x-icon="" aria-hidden="true"></i><span class="x-hidden-desktop"> ' . __( 'Search', '__x__' ) . '</span></span>'
. '</a>'
. '</li>';
} else {
$items .= '<li class="ubermenu-item ubermenu-item-level-0 x-menu-item x-menu-item-search">'
. '<a href="#" class="ubermenu-target x-btn-navbar-search">'
. '<span><i class="x-icon-search" data-x-icon="" aria-hidden="true"></i><span class="x-hidden-desktop"> ' . __( 'Search', '__x__' ) . '</span></span>'
. '</a>'
. '</li>';
}
}
}
return $items;
}
add_filter( 'wp_nav_menu_items', 'x_navbar_search_navigation_item', 9998, 2 );
// =============================================================================
Please check your site now.
You’re welcome.
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.