I’ve three headers in my theme, and i theming the shop with my theme using templates overriding default templates.
i’ve this in my header.php
Header 1: For my Home site (Not shop)
Header 2: For all pages of my site (Not shop)
Header 3: For shop (Product Categories, single product, archive product)
But, when i buy any product, i go to any checkout page (Register, Cart, My Account, etc), Header 2 appears.
Simplified header.php code:
if(!is_woocommerce()) {
<!--Header WordPress-->
if(is_home);
Home site header (Header 1)
} else {
All site header (except Home) (Header 2)
<!--End Header WordPress-->
} else { // Woocommerce conditional
Shop header (Header 3)
}
How to solve it?
The cart and checkout are standard pages with short codes and aren’t included in the other Woo templates, i.e.
is_woocommerce()won’t return true for them. So perhaps useinstead to target them.
Edit:
Replace
checkout-page-slugorother_shop_pagewith the slug of a page you want to target to have the shop header: