I'm building a custom theme for a client... I am trying to set up a static front page, but no matter what page I select it falls back to a custom post type archive page. I have confirmed that I can set other static pages to templates like my About page, but if I set my About page as the static home page it just falls back to archive-project.php
.
<?php
/**
* @author Mark Abel
* @package clientname/home
* @version 1.0
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
get_header(); ?>
<?php /* Template Name: Home */ ?>
<?php get_template_part( 'partials/partial', 'sidenav' );?>
<section class="masonry__container" id="masonry__container">
<div class="masonry" id="masonry">
<?php
if ( have_posts() ) :
while ( have_posts() ) : the_post(); ?>
<?php
$project_for = get_post_meta($post->ID, "project_for", true);
$has_video = (get_post_meta($post->ID, "has_video", true));
$hide_single_link = (get_post_meta($post->ID, "hide_single_link", true));
?>
<article class="masonry__tile" data-aos="zoom-in">
<img src=<?php the_post_thumbnail_url(); ?> alt="an image" />
<div class="masonry__overlay"><div class="masonry__title">
<?php echo get_the_title() ?>
</div>
<div class="masonry__project">
<?php echo $project_for ?>
</div>
<span></span>
<?php if ($hide_single_link) : ?>
<a class="masonry__cta masonry__video" href=<?php echo get_post_meta($post->ID, "video_link", true) ?>>Play video</a>
<?php else : ?>
<div class="masonry__cta"><a href="<?php echo get_post_permalink(); ?>">Click to view</a></div>
<?php endif ?>
<?php if ($has_video and !$hide_single_link) : ?>
<a class="masonry__video" href=<?php echo get_post_meta($post->ID, "video_link", true) ?>>Play video</a>
<?php endif ?>
</div>
</article>
<?php endwhile;
endif;
wp_reset_postdata();
?>
</div>
</section>
</body>
<!-- Footer -->
<?php get_footer(); ?>
</html>