WordPress – Blog template with different header to rest of site

I would like to change one thing on my wordpress custom template – there are big image sliders used throughout the site except on the contact us, checkout and my account pages. The blog page was added after these were created, so in the header.php file this is what is currently there to exclude the slider images (or include) from the necessary pages:

if(!is_cart() && !is_checkout() && !is_account_page()) :
if(is_page( ‘contact-us’ )):
get_template_part( ‘template-parts/header/header’, ‘map’ );
else:
get_template_part( ‘template-parts/header/header’, ‘slider’ );
endif;
endif;

I added this to the code and it doesn’t work:

if(**!is_blog() &&** !is_cart() && !is_checkout() && !is_account_page()) :
if(is_page( ‘contact-us’ )):
get_template_part( ‘template-parts/header/header’, ‘map’ );
else:
get_template_part( ‘template-parts/header/header’, ‘slider’ );
endif;
endif;

It seemed to me that is all I would need to do but clearly I need some assistance.

Read more here:: WordPress – Blog template with different header to rest of site

Leave a Reply

Your email address will not be published. Required fields are marked *