I'm trying to set a custom static front page for my Wordpress, with a custom template.
I create landingpage.php
in wp-content/themes/my_theme
and I create a new page in my wordpress admin with LandingPage model selected.
If I go to my_website.com/landing-page/
my custom page works and 'Hello World!' appears, but if I set my custom page as a static front page and go to my_website.com/
my 'Hello World!' message doesn't display.
My landingpage.php
code:
<?php /* Template Name: LandingPage */ ?>
<?php get_header(); ?>
<div class="wrap">
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php
while ( have_posts() ) : the_post();
get_template_part( 'template-parts/page/content', 'page' );
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
endwhile;
?>
<h1>Hello World!</h1>
</main>
</div>
</div>
<?php get_footer();
Any idea? thx