Woocommerce conditional headers
-
I want to load specific headers for different woocommerce product categories replacing the default get_header(shop) with custom headers. I’m using this function below but it isn’t working. Can anyone help?
add_action( ‘init’, ‘conditional_headers’ );
function conditional_headers() {
if ( has_term(‘coats’, ‘product_cat’) ) {
get_header(‘coats’);
} elseif ( has_term(‘blue’, ‘product_cat’) ) {
get_header(‘blue’);
}
}
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Woocommerce conditional headers’ is closed to new replies.