Duplicated posts in pagination
-
Hello, it might be strange asking this question here, but i will try.
This is my query, it’s so simple (the query is generated by canvas plugin)
this is only an example of what the query var contain$query_var = [ 'post_type' => 'new', 'orderby' => 'date', 'order' => 'DESC', 'paged' => $paged, 'posts_per_page' => 3 ]; $query = new WP_Query($query_var);
when i press the load more button, it shows me duplicated posts randomly, although the posts aren’t duplicated in the db
This is the generated SQL query
SELECT SQL_CALC_FOUND_ROWS eepir_posts.ID FROM eepir_posts INNER JOIN eepir_postmeta ON ( eepir_posts.ID = eepir_postmeta.post_id ) WHERE 1=1 AND eepir_posts.ID NOT IN (2405,101648,101576,101582,101586,101598,123796,107475,107695,123304,102506,102126,102034,102573,119231,123818,103813,85842,86197,86087,126258,126266,111468,111492,97183,124539,99686,99667,99642,99628) AND ( \n ( eepir_postmeta.meta_key = 'is_english' AND eepir_postmeta.meta_value != '1' )\n) AND eepir_posts.post_type = 'new' AND ((eepir_posts.post_status = 'publish')) GROUP BY eepir_posts.ID ORDER BY eepir_posts.post_date DESC LIMIT 3, 3
i notic that when i change the orderby arg to something else, like orderby ID
$query_var = [ 'post_type' => 'new', 'orderby' => 'ID', 'order' => 'DESC', 'paged' => $paged, 'posts_per_page' => 3, ];
it works fine.
how can i fix this?
Thank you
- The topic ‘Duplicated posts in pagination’ is closed to new replies.