I understand that you have modified the default WP query, how can I access it and create my own pagination?
Thank you
//Infinite Scroll Search.php
function wp_infinitepaginate_search(){
$paged = $_POST['page_no'];
$offset = $paged *10-10;
global $wp_query;
$args = array(
'offset' => $offset,
'posts_per_page' => 10
);
//$wp_query = new WP_Query( $args );
$objeto = new WP_Query($args);
$posts = $objeto->posts;
foreach($posts as $post) {
echo '<h2 class="feed-card-post-title">'.get_the_title($post).'</h2>';
}
wp_reset_postdata();
exit;
}