Answer provided in the comments:
global $wp_query;
$big = 999999999; // need an unlikely integer
$pagination_args = array(
'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var('paged') ),
'mid_size' => 1,
'total' => $wp_query->max_num_pages
);
if(have_posts()):
while(have_posts()):
the_post();
//individual search result
endwhile;
wp_reset_postdata();
echo paginate_links($pagination_args);
endif;
Related Posts:
- Post_count only shows the number of results per page
- Pagination not working for Custom search form & custom result template
- Pagination broken when merging search results with additional WP_Query
- Pagination wont work with search results template [duplicate]
- Search – Ajax – Alter Query Parameters with Pagination
- Add custom search results to main WP search [duplicate]
- wp_query ‘s’, search filter with pagination is not working
- WordPress pagination not working on template search.php
- Cutom wp_query for geolocation search, pagination not working
- How do I get my custom query to work with search results after the first page?
- How to filter a static post page with ajax and $wp_query
- Pagination repeating posts on search results
- Search results stuck on page 1
- Pagination on a WP_query not showing navigation links
- How to paginate wordpress [gallery] shortcode?
- Search custom taxonomy term by name
- paginate_links ignore my format
- How to paginate attachments in a secondary query as gallery?
- How to adjust found_posts so that it accounts for offset and pagination
- pagination doesn’t show up for custom post type
- Pagination causes error 404 when used with front-page.php
- How to search by title or tags exclusively?
- Paginated pages are showing correct content but pagination links are not
- WordPress search exact match
- How do I search WordPress by different fields without a plugin?
- Using next/previous_posts_link with customised search
- WordPress custom search form with pre_get_posts not work
- Is there a PHP function that can match anything after the given URL, so my IF statement will work in each instance?
- Pagination for custom query on single.php
- Pagination doesn’t work in custom page template [duplicate]
- WP_QUERY loop, offset in the arguments and the paginate_links – can these work together?
- Too many posts cause slow load when paginating
- How to output different posts per page?
- Multiple WP_Query loops with Pagination Not Working
- Custom pagination with WP_Query generating 404 error
- Modifying the Search Results
- Offset Page Loops and Pagination
- Querying on multiple taxonomies pulled from $_GET checkbox array not working?
- WP_Query Not Recognizing Taxonomy Parameter in Custom Search
- Get pagination working for custom loops within page templates
- Custom Search Not Consistent with Results
- Editing the default wordpress search
- pagination with ‘no_found_rows’ => true,
- how to handle multiple ajax wordpress queries?
- How to return a 404 when custom query matches nothing?
- Search by post id in a specific page then auto-redirect to searched post
- Pretty urls for custom pagination
- Search for “2nd” also returns “22nd” in wp_query
- Custom post type archive pagination query issue
- paged variable not working for category/custom post archive
- WordPress Blog Posts with Pagination inside a Page/Post
- Add filter post_where and passing post_type argument
- wp_query search not taking keywords with together for multiple words
- new WP_Query messes up pagination
- Wildcard search in WP Query
- Pagination works in custom query loop but it doesn’t work in shortcode
- “paged” in WP_Query returns 0 posts
- Search Page Returns Nothing
- wp_query show all values
- change posts_orderby of the callback wp_query?
- Notice thrown when creating numeric pagination on custom query
- Content not displaying on paginated page
- Second loop pagination changes URL, not content
- Custom Homepage Pagination using WP_Query
- Search.php – return number of results but cannot loop through
- Adding pagination to sub-wp_query within a singular post page
- Pagination problem by using WP_Query
- WP_Query and pagination AGAIN?
- WordPress search WP_Query to cover multiple post types and their custom fields?
- adding pagination to a foreach loop in wordpress
- How to prevent WP_Query from filtering on ‘s’ but keep ‘s’ for other purposes?
- Add dynamic search to paginated WP_Query
- Display the search results like the original pages
- Pagination on archive.php not working?
- How to use jQuery validation to set the search bar to accept only a specific input?
- Search with WP_Query, but ignore href URLs in anchor tags?
- pagination functions are not working
- WordPress pagination not returning posts on second page
- 3 wp_query on one page with pagination for last query
- Custom pagination (Title, date and teaser)
- custom query – offset to pagination
- How to make the default WordPress search return borader results
- Add pagination to table generated by wp_query
- WP_Query with meta_value_num and meta_query not paged correctly
- Pagination in custom query in a category page
- WordPress WP_Query Array Custom search via taxonomies
- Custom post type blog pagination conflict
- What is wrong with this pagination code?
- Manipulating a query
- Can’t get pagination to work with this WP_Query loop
- Pagination in custom loop [duplicate]
- Query posts by custom fields
- Pagination in WP query with transient API
- Multiple loops on index page with sticky post and pagination
- Searching in specific custom post type
- Pagination not working in secondary query
- WP Paginate not working properly
- Search (Custom Form, Custom Search Result)
- How does Show Posts based on a keyword search work in WP_Query
- Pagenavi with archive page