Home » Topics » Technical and configuration issues » Actions and filters » Create custom infinite pagination
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; }
I installed https://fr.wordpress.org/plugins/yith-infinite-scrolling/
It works like a charm with WPSOLR.
Does it work with posts and pdf?
Yes, with any post type your search returns.
🙂
You must be logged in to reply to this topic.