I was actually dealing with this same issue earlier today. I compared the code I’d written for a site using paginate_links()
a few weeks prior ( where it worked ) and the site I was working on today ( where it didn’t work ) and found the deal-breaker: when you associate the page number in either the base or format param with a url param, you have to define add_args in your arguments.
It can be as simple as assigning an empty array to add_args
. The code below will work for you.
$page_links = paginate_links( array(
'base' => add_query_arg( 'pagenum', '%#%' ),
'format' => '',
'prev_text' => __( '← Vorige', 'aag' ),
'next_text' => __( 'Volgende →', 'aag' ),
'total' => $num_of_pages,
'current' => $pagenum,
'add_args' => array(),
) );
Related Posts:
- Changing pagination list class
- Paged posts – how to use numbers and next/previous links?
- Paginate links with “ugly” and “pretty” permalinks?
- Strange paginate_links behavior. First page link is always whatever page I’m on, all other links are correct
- Pagination Not Displaying on Custom Term Archive
- Combining WordPress pagination functions for archives and search results
- paginate_links() outputs extra empty pages on custom loop
- In pagination, change link for page 1 to homepage
- Last page in pagination does not match max_num_pages – the overall post count is less according to pagination
- Invalid previous pagination links generated from paginate_links()
- Using Ajax in the prev_posts_link and next_posts_link
- Limiting number of visible links displayed with wp_link_pages
- search with pagination not working as expected
- Pagination Not Working on `WP_Query` Archive Page
- Include a leading zero in pagination
- Pagination Links showing incorrect previous page number
- Custom admin page pagination permissions error
- Paginate Links – Mid Size Less Than 2
- Pagination on WP_User_Query not updating current page
- Automatically adding a link to the next page link before ” tag in posts?
- How to add pagination to category templates
- How to Show Next-Previous Link Only
- Show number of pagination pages even when total under two
- Can’t Add Pagination
- Sidebar pagination posts not shown when sidebar is in single.php
- Broken pagination links on WP 4.9.10 blog pages
- How to add post page pagination to template part?
- 404 page not found on pagination in home page while navigating to next page
- The pagination is working on Local, not on LIVE. why?
- Paginate Links in Wp Query Shortcode
- Extra pagination pages being wrongly generated
- Google Indexed sub pages in wordpress pagination in post
- Paginate Links function: Page 1 doesn’t work
- Disable pagination on frontpage
- Paginating custom posts in categories yields a 404 error
- WordPress 404 pagination (/page/2) error?
- How can I get my pagination to recognize that it is on the first page?
- Default pagination in Home/Front page
- Pagination only working on index page not on a template page
- Pagination Broken on Loop using ACF
- Why do you need an unlikely integer in paginating?
- paginate_links() don’t properly work in search.php?
- 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
- Passing custom args in paginate_links
- Paginate a list of users?
- Pagination that includes “view all on one page”
- Custom page-links for paginated posts | wp_link_pages quicktag
- How to let crawlers search paginated comments?
- How do I insert CSS into a function?
- wp_list_categories pagination
- Insert pagination links – wp_link_pages() – before filters on posts
- Pagination for multiple queries for different authors on author.php
- WordPress 5.5 breaks pagination in an older plugin
- How to get “nexepagelink” and “previoiuspagelink” in wp_link_pages?
- Paginate Pages by only showing 3 pages at most
- Using Pagination with Timber Routes
- Is it possible to have pagination with an offset loop?
- Authors list Pagination?
- Exclude certain post formats from pagination
- How to use pagination on costum post type
- Archive pagination not working
- Wp pagination for custom database table
- How to implement a slideshow on WP similar to these examples?
- Page with Multiple Loops Breaking Pagination
- The paging is very slow under a large number of articles
- Customizing Latest Post Pagination
- WordPress Pagination is not shown
- Show multiple next and previous posts
- Page not found yet the posts are listed?
- Search URL redirect problem
- Pagination don’t list all entries on Index.php
- WordPress default gallery pagination when in page (is_page)?
- Understrap Custom Pagination
- Pass global variable from Page 1 to page 2 (Pagination)
- How to remove url from omission dots in WordPress pagination?
- Pagination not working on archive.php
- Pagination 301 redirecting page 1
- change pagination url
- I want to create pagination for my custom post type archive that i am displaying with loop
- 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
- 404 Error on pagination with WP Query
- What is wrong with my code ? pagination does not show up
- Paginating custom query on category template
- Add Custom Pagination Permalink
- Pagination for custom post type not working [duplicate]
- Pagination with wp_pagenavi not working on custom page
- Add Pagination in custom loop
- Custom Post Type Pagination For Genesis Child Theme [closed]
- Modifying previous_posts link to use AJAX
- paginate_links with select option
- Wrong rewrite rules
- How to change `page` slug in pagination? on a specific pagination result (not globally)
- Two pagination in one page without AJAX
- Two pagination in one page without being synchronous
- Change “/” (slash) before page number in pagination path to “-” (hyphen)
- Pagination only showed when no category is set in wp_query