• I was able to get the Main Navigation moved from the header, but now im having a hard time getting the cart moved back inline with the main navigation.
    I used a snippet from searching the forums to move the menu,

    function child_theme_init() {
    
    	remove_action( 'storefront_header', 'storefront_primary_navigation', 50 );
    	add_action( 'storefront_before_content', 'woa_primary_nav_wrap', 5 );
    	add_action( 'woa_primary_nav', 'storefront_primary_navigation' );
    }
    add_action( 'init', 'child_theme_init' );
    
    function woa_primary_nav_wrap() {
    	?>
    		<div class="col-full primary-nav-wrap">
    			<?php do_action( 'woa_primary_nav' ); ?>
    		</div>
    	<?php
    }

    How would i do this to move the cart as well?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hey,

    Very similar you’ll need to remove the cart and add it back with the appropriate priority. IE;

    remove_action( 'storefront_header', 'storefront_header_cart', 60 );
    add_action( 'woa_primary_nav', 'storefront_header_cart', 10 );
    Thread Starter mmccoy223

    (@mmccoy223)

    ok, Just so I get it right

    function child_theme_init() {
    
    	remove_action( 'storefront_header', 'storefront_header_cart', 60 );
            add_action( 'woa_primary_nav', 'storefront_header_cart', 10 );
    }
    add_action( 'init', 'child_theme_init' );
    
    function woa_primary_nav_wrap() {
    	?>
    		<div class="col-full primary-nav-wrap">
    			<?php do_action( 'woa_primary_nav' ); ?>
    		</div>
    	<?php
    }

    Hey,

    No, you should add the code I gave you to your original snippet. Add it beneath this line:

    add_action( 'woa_primary_nav', 'storefront_primary_navigation' );

    Cheers.

    Thread Starter mmccoy223

    (@mmccoy223)

    Yes, got it. How do i make it inline with the menu? it under it now..

    You’ll need some CSS to do that. I can’t help without seeing a link though.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Move Cart from main header’ is closed to new replies.