mercredi 29 août 2018

Change header based on parent product category in Woocommerce

I am running an e-commerce store where I have two custom headers for different sides of the store. I am wondering if is possible that for:

  • the parent product category A to display header A
  • the parent product category B to display header B

I just don't know where to put it in my theme.

Here is my actual code example:

if(is_category('category-a-slug')){
    get_header('a');
}elseif(is_category('category-b-slug')){
    get_header('b');
}

Any help is appreciated.

Aucun commentaire:

Enregistrer un commentaire