Skip to main content
added 51 characters in body
Source Link

Have you tried adding the following before the main args and the loop?

<!-- Modify pagination function for front page --> <?php global $paged, $wp_query, $wp; $args = wp_parse_args($wp->matched_query); if ( !empty ( $args['paged'] ) && 0 == $paged ) { $wp_query->set('paged', $args['paged']); $paged = $args['paged']; } ?> 

Then add the pagination like so:

<?php $query$args = array( 'posts_per_page' => 12, 'paged' => $paged ); ?> $query = new WP_Query($args); <?php if ($query->have_posts()) : $i = 1; ?> <?php while ( $query->have_posts() ) : $query->the_post(); ?> // Content Here <?php $i++; endwhile; ?> <?php else : ?> <h2>Content not found!</h2> <?php endif; ?> //pagination code 

In my case I am using WP pagenavi, so I would use:

<?php wp_pagenavi( array( 'query' => $query )); ?> <?php wp_reset_query(); ?> 

Have you tried adding the following before the main args and the loop?

<!-- Modify pagination function for front page --> <?php global $paged, $wp_query, $wp; $args = wp_parse_args($wp->matched_query); if ( !empty ( $args['paged'] ) && 0 == $paged ) { $wp_query->set('paged', $args['paged']); $paged = $args['paged']; } ?> 

Then add the pagination like so:

<?php $query = array( 'posts_per_page' => 12, 'paged' => $paged ); ?> <?php if ($query->have_posts()) : $i = 1; ?> 

Have you tried adding the following before the main args and the loop?

<!-- Modify pagination function for front page --> <?php global $paged, $wp_query, $wp; $args = wp_parse_args($wp->matched_query); if ( !empty ( $args['paged'] ) && 0 == $paged ) { $wp_query->set('paged', $args['paged']); $paged = $args['paged']; } ?> 

Then add the pagination like so:

<?php $args = array( 'posts_per_page' => 12, 'paged' => $paged ); ?> $query = new WP_Query($args); <?php if ($query->have_posts()) : $i = 1; ?> <?php while ( $query->have_posts() ) : $query->the_post(); ?> // Content Here <?php $i++; endwhile; ?> <?php else : ?> <h2>Content not found!</h2> <?php endif; ?> //pagination code 

In my case I am using WP pagenavi, so I would use:

<?php wp_pagenavi( array( 'query' => $query )); ?> <?php wp_reset_query(); ?> 
added 51 characters in body
Source Link

Have you tried adding the following before the main args and the loop?

<!-- Modify pagination function for front page --> <?php global $paged, $wp_query, $wp; $args = wp_parse_args($wp->matched_query); if ( !empty ( $args['paged'] ) && 0 == $paged ) { $wp_query->set('paged', $args['paged']); $paged = $args['paged']; } ?> 

Then add the pagination like so:

<?php $product_args$query = array( 'posts_per_page' => 12, 'paged' => $paged ); ?> <?php if ($query->have_posts()) : $i = 1; ?> 

Have you tried adding the following before the main args and the loop?

<!-- Modify pagination function for front page --> <?php global $paged, $wp_query, $wp; $args = wp_parse_args($wp->matched_query); if ( !empty ( $args['paged'] ) && 0 == $paged ) { $wp_query->set('paged', $args['paged']); $paged = $args['paged']; } ?> 

Then add the pagination like so:

<?php $product_args = array( 'posts_per_page' => 12, 'paged' => $paged ); ?> 

Have you tried adding the following before the main args and the loop?

<!-- Modify pagination function for front page --> <?php global $paged, $wp_query, $wp; $args = wp_parse_args($wp->matched_query); if ( !empty ( $args['paged'] ) && 0 == $paged ) { $wp_query->set('paged', $args['paged']); $paged = $args['paged']; } ?> 

Then add the pagination like so:

<?php $query = array( 'posts_per_page' => 12, 'paged' => $paged ); ?> <?php if ($query->have_posts()) : $i = 1; ?> 
Source Link

Have you tried adding the following before the main args and the loop?

<!-- Modify pagination function for front page --> <?php global $paged, $wp_query, $wp; $args = wp_parse_args($wp->matched_query); if ( !empty ( $args['paged'] ) && 0 == $paged ) { $wp_query->set('paged', $args['paged']); $paged = $args['paged']; } ?> 

Then add the pagination like so:

<?php $product_args = array( 'posts_per_page' => 12, 'paged' => $paged ); ?>