Pagination Showing Same Records on Each Page
-
I’m using WP_Query to query a custom post type on a template page. My pagination is showing and appears to be correct but I get the same results on each page. When I check the Query being run the LIMIT start value is not changing.
Template code
$args = array ( 'post_type' => 'event', 'pagination' => true, 'order' => 'DESC', ); global $wp_query; $wp_query = new WP_Query( $args ); if ($wp_query->have_posts()) : while ($wp_query->have_posts()) : $wp_query->the_post(); // Get content endwhile; pagination(); else : // Not found endif;
URL format
https://localhost/wp-test-site/page-name/page/3/Query generated
SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'event' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') ORDER BY wp_posts.post_date DESC LIMIT 0, 2
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Pagination Showing Same Records on Each Page’ is closed to new replies.