• I created a template called ‘blog homepage’. It’s a page visitors will visit when they want to read blog posts.

    I’ve limited the page to show the latest five posts. I can’t seem to figure out how to add a ‘next page’ type of link at the bottom to be able to navigate back and forth.

    I’ve played with the wp_link_pages function but the best I could do is that it will take a visitor to the next page on my database (eg. about us, contact us), and not page 2 of my blog page that shows posts 6-10 (1-5 is on the first page).

    Here’s the code I’m using for the template:

    <?php
    $args = array( 'posts_per_page' => 5, 'order'=> 'DSC' );
    $postslist = get_posts( $args );
    foreach ( $postslist as $post ) :
      setup_postdata( $post ); ?> 
    
    			<div class="latest-post">
    
    				<p class="blog-date blog-main-list"><?php the_date(); ?></p>
    				<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    				<p class="byline">by <?php the_author(); ?></p>
    				<span style="blog-post"><?php the_excerpt(); ?></span>
    				<a href="<?php the_permalink(); ?>" class="blog-read-more">Read More >></a>
    
    				<hr>
    			</div>
    
    			<?php
    endforeach;
    wp_reset_postdata();
    ?>
  • The topic ‘Adding 'next page' at bottom of page template’ is closed to new replies.