Hey!
I have changed the code as you said.
but the code that @paul.r gave me still assign the same menu to both places, the cart and the store menues turns to be the same menu from some reason.
add_filter( 'wp_nav_menu_args', 'custom_blog_menu' );
function custom_blog_menu( $args ) {
if ( is_woocommerce() || is_page( array( 3010, 3007 ) ) ) {
$args['theme_location'] = 'store-menu';
$args['menu'] = 'store-menu';
}
return $args;
}
add_filter( 'wp_nav_menu_args', 'custom_cart_menu' ,99);
function custom_cart_menu( $args ) {
if ( x_is_shop() || x_is_product_category() || is_product_tag() || is_woocommerce() || is_page( array( 3010, 3007 ) ) ) {
$args['theme_location'] = 'cart-menu';
$args['menu'] = 'cart';
}
return $args;
}
I just want that the Store menu to be places instead of the top nav primary menu
and that the menu on the left side will be the cart menu.
the ID in this code in wpheader.php #star and #cart are same position. its just that cart is shown in shop page and star shown in rest of pages which are not shop.
please help me switch main menu (x-navbar) to store menu (store-menu) and the star menu (5776) with cart menu (cart).
This is the code i have in wpheader.php right now currently:
<?php
// =============================================================================
// VIEWS/ETHOS/WP-HEADER.PHP
// -----------------------------------------------------------------------------
// Header output for Ethos.
// =============================================================================
?>
<?php x_get_view( 'global', '_header' ); ?>
<?php x_get_view( 'global', '_slider-above' ); ?>
<header class="<?php x_masthead_class(); ?>" role="banner">
<?php x_get_view( 'ethos', '_post', 'carousel' ); ?>
<?php x_get_view( 'global', '_topbar' ); ?>
<?php x_get_view( 'global', '_navbar' ); ?>
<div id="cart">
<?php if ( x_is_shop() || x_is_product_category() || is_product_tag() ) : ?>
<?php ubermenu( 'cart' , array( 'theme_location' => 'Cart-Menu' ) ); ?>
<?php else : ?>
<?php endif; ?>
</div>
<div id="star">
<?php if (is_woocommerce() || is_page( array( 3010, 3007 ) ) ) : ?>
<?php else : ?>
<?php ubermenu( '5776' , array( 'theme_location' => 'Secondary-Menu' ) ); ?>
<?php endif; ?>
</div>
<?php x_get_view( 'ethos', '_breadcrumbs' ); ?>
</header>
<?php x_get_view( 'global', '_slider-below' ); ?>
<?php x_get_view( 'ethos', '_landmark-header' ); ?>
Thanks for the help! in advance!
Adding a Video of what i did:
please feel free to test in store page.
Adding additional information needed in Secure note.