Pagination with WP_query giving same items in each page

After digging for sometime I’ve managed to solve it. The issue was I wasn’t passing paged variable in the args. After passing it and tweaking the pagination logic it is working now. <?php $data = getData(); if(!empty($_REQUEST[‘posts’])){ $args = array( ‘post_type’ => ‘post’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => 15, ‘category_name’ => $_REQUEST[‘posts’], ‘paged’ => $paged … Read more