I’m building a WP theme using Bootstrap. Aparently, all templates were working fine until I tried to display a list of recent post on the front page. Basically, the loop it’s not displaying posts (it displays a link to the home page instead). When I head to the site’s blog, it enlists the posts correctly. Things you may need to know: The front page is set to display a static page (Home), as well as the posts page (Blog).
I'd like to see the lists of posts on the front page, and if it's possible, show only the last three ones.
Here's the code of front-page.php:
<?php get_header(); ?>
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
<h2 class="text-center">Our Mission</h2>
<img class="img-responsive" src="http://localhost/WP/wp-content/uploads/2014/09/6.jpg"><br>
<p class="text-justify">Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
</div>
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
<h2 class="text-center">Our Vision</h2>
<img class="img-responsive" src="http://localhost/WP/wp-content/uploads/2014/09/7.jpg"><br>
<p class="text-justify">Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
</div>
</div>
</div>
<div class="container">
<h2>Latest Blog Posts</h2><br><br>
<div class="row">
<div class="col-md-8">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<p><em><?php the_time('F j, Y'); ?></em></p>
<?php the_excerpt(); ?>
<?php endwhile; else: ?>
<p><?php _e('Sorry, there are no posts.'); ?></p>
<?php endif; ?>
</div>
<div class="col-md-4">
<?php get_sidebar(); ?>
</div>
</div>
</div>
<?php get_footer(); ?>
Hope you guys can help me. Thanks in advance!
blog.php
instead offront-page.php