How to add pagination (2 posts)

  1. brian914
    Posted 4 years ago #

    I am trying to add pagination to my blog page. I have the following to loop through my posts and grab 5, but don't really know how to add pagination. I have tried a few things, but pagination doesn't seem to show up. What do I have to do?

    Thank you so much for any help!

    	$query = array(
    		'posts_per_page' => '5',
    		'post_type' => 'post'
    	$queryObject = new WP_Query($query);
    	if ($queryObject->have_posts()) {
    		while ($queryObject->have_posts()) {
    			echo the_title();
    			echo the_excerpt();
    			} // End if statement
    	wp_reset_query();  // Restore global post data
  2. Samuel B
    Posted 4 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic