I have been trying to apply answers provided on this forum regarding WordPress pagination on static pages, but cannot seem to make them work on my page.
The closest I was able to make was a pagination system loading a page full of posts that were not even uploaded as excerpts but provided in complete form.
The answer I am looking for is for “pagination” to upload older posts on the same front page of the website whenever i click “Older” posts, and the other way around with “Newer”.
My WordPress reading settings are as follows:
A static page
Front page: Home,
Posts page: Home
My front-page.php code is (nested withing a column of my page using bootstrap) :
<!----- POSTS COLUMN BEGIN ------------->
<div class="col-xs-12 col-sm-8 col-md-8">
<?php
query_posts('posts_per_page=5');
while(have_posts()) : the_post(); ?>
<date class="text-muted"><?php the_date("m.d.Y") ?></date>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<p><?php the_excerpt(); ?></p>
<hr>
<?php endwhile; wp_reset_query(); ?>
<br >
<!---- PAGINATION BUTTONS BEGIN ------->
<nav>
<ul class="pager">
<li class="previous"><a href="#"><span aria-hidden="true">←</span>Older Posts</a></li>
<li class="next"><a href="#">Newer Posts <span aria-hidden="true">→</span></a></li>
</ul>
</nav>
<!---- PAGINATION BUTTONS END --------->
</div>
<!----- POSTS COLUMN END ------------->
Currently functions.php does not contain anything regarding pagination. I have also left the “Older” & “Newer” buttons in the code.
Thank you for your help in advance!