Created
September 14, 2013 01:40
-
-
Save zulfnore/6558084 to your computer and use it in GitHub Desktop.
WP_Query and pagination
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1; | |
$strapvert_blog_query = new WP_Query( | |
array( | |
'paged' => $paged, | |
'post__not_in' => get_option( 'sticky_posts' ), | |
) | |
); | |
?> | |
<?php if ( $strapvert_blog_query->have_posts() ) : ?> | |
<?php /* Start the Loop */ ?> | |
<?php while ( $strapvert_blog_query->have_posts() ) : $strapvert_blog_query->the_post(); ?> | |
<?php | |
get_template_part( 'content', 'blog' ); | |
?> | |
<?php endwhile; ?> | |
<?php strapvert_content_nav( 'nav-below' ); ?> | |
<?php else : ?> | |
<?php get_template_part( 'no-results', 'index' ); ?> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem is pagination does not work - so what am I missing?