Wordpress - Reposition WooCommerce breadcrumb outside of wrapper content

Ok I seem to have got it working. I added this in the functions file...

//Reposition WooCommerce breadcrumb 
function woocommerce_remove_breadcrumb(){
remove_action( 
    'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20);
}
add_action(
    'woocommerce_before_main_content', 'woocommerce_remove_breadcrumb'
);

function woocommerce_custom_breadcrumb(){
    woocommerce_breadcrumb();
}

add_action( 'woo_custom_breadcrumb', 'woocommerce_custom_breadcrumb' );

Then added...

do_action('woo_custom_breadcrumb'); 

...where I wanted the breadcrumb to show.

Tags:

Php

Plugins