I’m trying to serve different headers based on what type of page the user is on. This is my code.
<!-- IF HOME -->
<?php if ( is_front_page() && is_home() ) : ?>
<?php get_template_part( 'template-parts/headers/home-header' ); ?>
<!-- IF TEMPLATES -->
<?php elseif ( is_page_template('archive-mobile_photo.php') ) : ?>
<?php get_template_part( 'template-parts/headers/home-header' ); ?>
<!-- IF POST -->
<?php else : ?>
<?php get_template_part( 'template-parts/headers/zine-header' ); ?>
<?php endif; ?>
What’s weird is that the homepage and post pages are working fine, but the check using is_page_template()
isn’t working. I have the query monitor plugin and it’s confirming the page is the archive-mobile_photo.php
template.
I’m pretty new to WordPress and I’m at a total loss.