This is my first time asking a question on this forum. I hope i can be specific enough. I am trying to replace the front page posts section of a WP template. I have the code below running fine on my index.php page (it gets the posts) when the WP theme is set to settings>reading>your latest posts BUT the way the WP theme "the thinker" is setup reading is set to static page and the posts are gotten through a blog template page (in same location as the index.php file) which gets the posts from loops in separately included files. I'd like to keep it set to static for a few reasons. My question is "Is there a reason why the code below would only work in an index.php file and not out of a blog-template file which is is in the same location as the index.php file. I've checked and the the template-parts called in the code are being called. It seems like there's just no posts to get (which there are).
Thank you for your time,
Dave
<!-- blog content -->
<div class="container">
<div class="row" id="primary">
<main id="content" class="col-sm-8" role="main">
<?php if ( have_posts() ) : ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
get_template_part( 'template-parts/content', get_post_format() );
?>
<?php endwhile; ?>
<?php the_posts_navigation(); ?>
<?php else : ?>
<?php get_template_part( 'template-parts/content', 'none' ); ?>
<?php endif; ?>
</main><!-- content -->
<!-- sidebar -->
<aside class="col-sm-4">
<?php get_sidebar(); ?>
</aside>
</div><!-- primary -->
</div><!-- container -->