Title: wp_paginate with get_posts
Last modified: October 7, 2019

---

# wp_paginate with get_posts

 *  [Shirley Studebaker](https://wordpress.org/support/users/shirley-studebaker/)
 * (@shirley-studebaker)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/wp_paginate-with-get_posts/)
 * I am trying to add pagination to a static home page that has blog listings below
   the home page content. I want to add page numbers below the posts. I am setup
   to see 4 posts (there are 7 total published posts) but it is not giving me page
   number for next 3 posts (assuming I should be seeing 1 2). Any help would be 
   VERY appreciated.
    [code] &lt;?php $paged = (get_query_var('paged')) ? get_query_var('
   paged') : 1; $postsPerPage = 4; $postOffset = $paged * $postsPerPage; $category
   = 'blog'; $args = array( 'category_name' =&gt; $category, 'post_type' =&gt; '
   post', 'post_status' =&gt; 'publish', 'posts_per_page' =&gt; $postsPerPage, '
   offset' =&gt; $postOffset, ); $myposts = get_posts( $args ); if ( $myposts ) {?&
   gt; &lt;div class="home-grid"&gt; &lt;?php foreach ( $myposts as $post ) : setup_postdata(
   $post ); ?&gt; &lt;div class="home-grid-content"&gt; &lt;h2&gt;&lt;?php the_title();?&
   gt;&lt;/h2&gt; &lt;?php echo get_the_excerpt( ); ?&gt; &lt;/div&gt; &lt;?php 
   endforeach; if (function_exists('wp_paginate')): wp_paginate(); endif; wp_reset_postdata();?&
   gt; [/code]
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fwp_paginate-with-get_posts%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [AlanP57](https://wordpress.org/support/users/alanp57/)
 * (@alanp57)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/wp_paginate-with-get_posts/#post-12008407)
 * I’ve sent some code that seems to work.
 *  Thread Starter [Shirley Studebaker](https://wordpress.org/support/users/shirley-studebaker/)
 * (@shirley-studebaker)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/wp_paginate-with-get_posts/#post-12009846)
 * It appears that this works for home posts page but not home static page…
 *  Plugin Author [AlanP57](https://wordpress.org/support/users/alanp57/)
 * (@alanp57)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/wp_paginate-with-get_posts/#post-12009947)
 * Are you getting posts but no pagination links?

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘wp_paginate with get_posts’ is closed to new replies.

 * ![](https://ps.w.org/wp-paginate/assets/icon-128x128.png?rev=1566512)
 * [WP-Paginate](https://wordpress.org/plugins/wp-paginate/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-paginate/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-paginate/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-paginate/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-paginate/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-paginate/reviews/)

## Tags

 * [get_posts](https://wordpress.org/support/topic-tag/get_posts/)
 * [Numbers](https://wordpress.org/support/topic-tag/numbers/)

 * 3 replies
 * 2 participants
 * Last reply from: [AlanP57](https://wordpress.org/support/users/alanp57/)
 * Last activity: [6 years, 7 months ago](https://wordpress.org/support/topic/wp_paginate-with-get_posts/#post-12009947)
 * Status: not resolved