I’m trying to have my posts post on another page(blog) and my ‘home’ page display as my front page. Both pages have their own templates assigned to them (home for home, blog for blog).
In the Reading settings, I’ve set front page as home, posts page as blog. But when I go to url.com/blog, it displays the same template as my home page. I’m not sure why it won’t display my two blog posts.
In my home.php template, I have the following code, could this be the issue?
<!-- Display featured images -->
<?php
$args = array('post_type'=> 'page');
query_posts( $args );
?>
<!-- Get featured images -->
<div class="main-thumb left">
<?php
if ( have_posts() ) {
while ( have_posts() ) {
the_post();
?>
<li>
<a href="<?php echo get_permalink(); ?>">
<div class="tint">
<div class="overlay caps">
<?php
echo(types_render_field("top-overlay", array("output"=>"html")));
?>
<?php
echo(types_render_field("bottom-overlay", array("output"=>"html")));
?>
</div> <!-- end .OVERLAY-->
<?php the_post_thumbnail(); ?>
</div> <!-- end .TINT-->
</a>
</li>
<?php
}
}
?>
</div> <!-- end .MAIN-THUMB-->
The posts page will always be index.php or home.php. That is, WordPress will always use one of those files to display your blog posts. Even if you set some other page in Settings (like ‘blog’), WP will ignore everything set for that page except the title. See the codex.