paginate_links
doesn’t work correctly in some (many) cases if you use the default base
. If you look at the generated source you can see what is happening: if you are on any page but the first, when using the default base– %_%
— paginate_links
will print an empty href=""
for the link back to page one. Of course, browsers will interpret this to be “this page” so the link to page one doesn’t work. I consider this very much a bug.
To get around it, pass a base
argument like: 'base' => site_url('%_%'),
, or 'base' => get_permalink().'%_%',
. Context matters which you choose, so be careful.
Related Posts:
- The next_posts_link() works only with original $wp_query
- Skipping first 3 posts in wp query
- Pagination not working on Custom Page Template
- Converting multiple loops into one single loop with pagination
- Lazy Load using WP_Query pagination
- Should $found_posts be returned as string in ‘found_posts’ filter hook?
- Blog post per page setting conflicting with custom WP_Query?
- How to : pagination in 3 different custom loops on the same page
- How safe is renovating $wp_query when doing WP_Query pagination in Page Template
- Why are my paginated posts always returning the same results?
- Getting blog pagination to work on page set as front page
- Manipulated offset and pagination, can’t display last post anymore
- Numbered Pagination Showing The Same Posts After Altering WP_Query
- Override wp_link_pages pagebreak with filter
- Can’t get pagination to work
- The next_posts_link() works only with original $wp_query
- Limit amount of pages shown in pagination within wp_query
- query_posts different amount of posts per page [duplicate]
- Adding additional data to WP_Post object
- WP_Query: Why is sticky post not first item in loop?
- Displaying the category name of a custom post type
- How to Group Posts by the First Letter or Number?
- WP_Query to work with custom view
- Most viewed post for the last 2 days using WP_Query
- Adding Post Counts to Menu (Nav) Programmatically?
- This AJAX Code Doesn’t Work – Looking for elegant solution
- I’m having some issues with previous_post_link() and next_post_link()
- Unable to modify(update) posts – Page not found
- When paginating a Page with the tag, how can the 2nd and subsequent page styles be customised?
- Hide Post comments when displayed via WP_Query
- Hiding posts in a list from specified categories
- wp query with dynamic taxonomies and terms?
- Blogroll – Different layout for first post
- WP_Query do not load specifed number of post
- How do I use `posts_distinct` correctly?
- Automatic value for custom fields for posts
- Loop through all product posts?
- How to find what index page a post is on?
- Display post from current category and same tag?
- Get Posts that are in the current month or later
- WP Query to Get Array of Slugs
- How can I sort posts by the date and a custom meta field?
- Hiding Draft Post In Admin
- How to verify wp user password by sql query in wp? [closed]
- How to filter my search in post if contains a word in title, content or excerpt?
- Making a custom Pagination for multi page blog post
- Lost draft under all posts and drafts
- Get user categories with most posts in it
- Query posts and return XML
- List authors with the last post title and order by last post date
- How to order posts by meta_value and title
- Adding a blog archive with pagination using WP_Query
- WordPress query_posts by tag doesn’t work anymore(?)
- using is_paged for hiding image on posts
- Ignore latest two posts
- Show posts by author of membership level (Paid Membership Pro)
- Print out last 3 blogposts
- Why posts array is empty?
- How to group only VISIBLE posts? [closed]
- How to check in functions.php if there is data in a WP_Query?
- Shortcode with ‘year’ parameter
- On what hook can I get the queried object’s final state?
- If no posts exist for current day and month, show the next available day of posts
- Get all custom posts with a certain taxonomy
- Link to date_query results in WordPress
- Query function not executed between element [closed]
- When WP_Query only returns 1 post, how do I automatically redirect to that post?
- Limiting post list by taxonomy
- Is there a function to get post info for any publish_status by post ID?
- How Can I Always Display A Particular Post First Using WP_Query?
- Search results with pagination not working
- Function is printing twice – any suggestions?
- Pagination Not Working With Custom Post Type Category
- Remove pagination if search returns empty
- Order posts inside bootstrap card columns
- How to use two query result together in one loop
- show loop id post , only first id can read
- Page with Category Returning 1
- filter posts based on menu_order
- Change archive results based on GET request
- Get 5 most recent categories
- Wp_query loop is not working as it should
- Show all posts from the tags without having to set all of them
- Is there a global page/post/product/anything ID?
- wp query custom orderby not custom field
- Thumbnail With Next/Prev Links Not Showing Next Post?
- Pagination and Related Posts
- Retrieve latest post by multiple categories with ID
- Update Post with Modified Data
- How to Include a common category in a custom Category Search
- How to display a paginated list of posts from one category on a page? [duplicate]
- wp_query select if have comments
- wp_query posts sorting doesn’t work
- Page not found after clicking on pagination
- custom sort posts in archive/taxanomy page
- Trying to create shortcode listing custom posts, but formating not being included
- Show Title/Date/Excerpt of first post & only Title for rest in Query [duplicate]
- Get posts after calculating meta key
- Next and Previous buttons are not showing on home page for post
- How edit footer copyright info? [closed]