I’m not aware of any generic helper – all the post-related navigation functions seem to be tied into the global WP_Query
instance. The only real useful function at your disposal is get_pagenum_link
:
$paged = max( 1, get_query_var( 'paged' ) );
if ( $number * $paged < $wp_user_query->total_users ) {
printf( '<a href="https://wordpress.stackexchange.com/questions/267947/%s">Next</a>', get_pagenum_link( $paged + 1 ) );
}
if ( $paged > 1 ) {
printf( '<a href="https://wordpress.stackexchange.com/questions/267947/%s">Back</a>', get_pagenum_link( $paged - 1 ) );
}
Note the function returns escaped strings by default, so no need for esc_url
.
Related Posts:
- How to display pagination links for WP_User_Query?
- Can I use paginate_links() to add a pagination list, yet prevent it from inserting links?
- Pagination on WP_User_Query not updating current page
- WP_User_Query counter not updating with pagination
- Why Am I getting an error when I add the number parameter to my WP_User_Query?
- Why do you need an unlikely integer in paginating?
- How to get the number of Pages in a single Post Pagination?
- Next/Previous Links in same category
- How To create ajaxed wp-pagenavi?
- Using paginate_links() to generate “1, 2, 3 … 10, 20, 30, 40… 55” paginations
- Combining WordPress pagination functions for archives and search results
- Passing custom args in paginate_links
- Custom paging function
- Broken pagination, need help figuring out why!
- How to grab a specific page of content from paginated post?
- Show content only on front page?
- paginate_links WP function
- Using pre_get_posts to filter out posts, pagination problem
- Getting 404 on taxonomy page
- Pagination gives 404 in template
- Frontpage pagination issue with paginate_links() function
- pagination with sticky posts
- Skip first post on Category Archive
- wordpress pagination, links appear but go nowhere when clicked
- How to make multiple page out of one post
- Pagination not applied on posts
- Remove h2 Tag in screen_reader_text
- Styling the_posts_pagination With Font Awesome
- 404 not found error on pagination
- Pagination on 2nd loop
- Page not found when clicking on pagination tab
- next_post_link for CPT only working for a few posts? weird!
- Why does pagination go to a blank page when navigating through home.php?
- Pagination with $_POST and $_SESSION
- How to create Alphabetic pagination with range?
- Site pagination issue
- Archive page pagination links redirecting to home page instead of going next page
- Default pagination is broken when use ‘static page’ as ‘front page’
- WordPress Gallery shortcode with pagination
- How to paginate with letters instead of numbers?
- Pagination in pages (not posts) with the twentythirteen theme?
- How to customize pagination links?
- search with pagination not working as expected
- Post Pagination Showing Same Posts Every Page at wordpress blog
- Pagination for search results from a custom query
- Check if “Break comments into pages” is selected
- Remember form field values with page navigation
- Custom posts not paginating on archive page and returning 404
- How do you choose to display specific posts/pages by parent url
- Customizing Latest Post Pagination
- Woocommerce products per page dropdown
- WordPress Pagination is not shown
- Show multiple next and previous posts
- How to add pagination to category templates
- Make posts_per_page value the same on all pages
- Page not found yet the posts are listed?
- Add pagination to this following template
- Search URL redirect problem
- Adding pagination to a custom template that uses custom post types?
- Why are my paginated result links not working?
- Pagination don’t list all entries on Index.php
- WordPress default gallery pagination when in page (is_page)?
- How do I hide a Gutenberg block when paginating
- Understrap Custom Pagination
- Pass global variable from Page 1 to page 2 (Pagination)
- How Change URL in Pagination pagebreak no plugins wordpress?
- How to remove url from omission dots in WordPress pagination?
- Use of rewind_posts() cause pagination to break
- Pagination not working on archive.php
- Pagination not working in custom post type but perfectly in posts
- Custom pagination with URL parameters
- Pagination 301 redirecting page 1
- change pagination url
- Pagination not working past page 3 on archive page of category
- Using the_posts_pagination with offset adds extra empty page
- Pagination is not working in custom page template
- Creating a Back button on detail post page to go back to blog page with same query strings and page id
- get_posts custom paging
- page/2 not working in wordpress it showing 404 page erorr
- How to implement pagination eg. newer – 3 – 4 – 5 – 6 – 7 – older
- Extra pagination pages being wrongly generated
- 404 Error on pagination with WP Query
- What is wrong with my code ? pagination does not show up
- Pagination re-direct to main page [duplicate]
- Paginating custom posts in categories yields a 404 error
- Using WP_List_Table and search_box(): How to Paginate the Found Search Results When Sending by Method «Post»?
- URL rewrite function and pagination with year in the url
- pagination custom post type on CP page
- Pagination for custom post type not working [duplicate]
- Pagination with wp_pagenavi not working on custom page
- how to apply Pagination on post
- Add Pagination in custom loop
- Custom Post Type Pagination For Genesis Child Theme [closed]
- Loading post like facebook on scrool to bottom [duplicate]
- Modifying previous_posts link to use AJAX
- How to remove post duplicate when using query_posts(‘offset=1’)
- paginate_links with select option
- How to change `page` slug in pagination? on a specific pagination result (not globally)
- Two pagination in one page without being synchronous
- Change “/” (slash) before page number in pagination path to “-” (hyphen)