do you mean post archive pagination? The paginate_links()
function accepts a type
parameter, so if all you need is a ul > li
format you could try out something like:
// archive pagination
global $wp_query;
$big = 999999999; // need an unlikely integer
echo paginate_links( [
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var('paged') ),
'total' => $wp_query->max_num_pages,
`type` => 'list',
] );
If you need a completely custom markup, you could try setting type
param to 'array'
and then build whatever you need with a foreach
loop.
docs: https://developer.wordpress.org/reference/functions/paginate_links/
Related Posts:
- How to add CSS Class to previous_post_link or get previous/next post link URL
- Next/Previous Links in same category
- Link to previous month’s posts
- How to get “nexepagelink” and “previoiuspagelink” in wp_link_pages?
- I want to remove numbers from the_posts_pagination function
- Pagination Links Not Showing Up on single.php posts on iOS Devices
- Problem when I try to insert pagination
- Sidebar pagination posts not shown when sidebar is in single.php
- How to add post page pagination to template part?
- the_posts_navigation is not working
- Default pagination in Home/Front page
- Page navigation not working correctly on index but only on categories
- I want the “next” and “previous” buttons to appear in my custom navigation function
- Changing pagination list class
- Pagination resolving to first page only
- Pagination of RSS2 feed
- Pagination for sub-pages
- Modifying WP_LIST_AUTHOR Functions to output all users in a grid (and Paginate)
- Problem: ( kriesi ) pagination doesn’t work in homepage [duplicate]
- How to ignore or disable nextpage tag?
- category/category_name pagination 404 error
- get_query_var(‘paged’) giving same result
- Show content only on front page?
- Getting 404 on taxonomy page
- Why am I getting a 404 on anything past page 1 of my query?
- Getting pagination for second loop to work on single.php
- 5 posts per page from single category, paginated
- WordPress custom URLs for pagination pages
- Home page not obeying post per page setting on the first page only
- How to add pagination to a single post
- WordPress rewrite rules for pagination on search page
- Styling the_posts_pagination With Font Awesome
- Pagination on 2nd loop
- How can I show a multipage post as a single, wrapped post?
- WordPress wp_link_pages show only next/prev link
- Why does pagination go to a blank page when navigating through home.php?
- Pagination with $_POST and $_SESSION
- wordpress is converting ?page=2 into /2
- Template hierarchy about pagination after front-page.php
- Add pagination to my custom loop [duplicate]
- Pagination with WordPress default gallery?
- How do i improve my custom pagination?
- Post Pagination Customization (wp_link_pages) Editing Navigation
- Default pagination is broken when use ‘static page’ as ‘front page’
- Paginate results from data fetched through array
- make a pagination that show posts by date
- Adding pagination on template page wordpress
- Pagination on custom post type not working if permalinks set to rewrite url
- Theme Option not Working Inside a Function
- Paginated Archives or Loop by Month
- search with pagination not working as expected
- Cannot go back to the first paginated page using pagination links
- Remember form field values with page navigation
- How do you choose to display specific posts/pages by parent url
- Style wp_link_pages as a select drop down list
- tax_query does not work with pagination with custom query (both wp_query and query_posts())
- Automatically adding a link to the next page link before ” tag in posts?
- paginate_comments_links() not working
- Hide content after going to page 2 of archive, show content when back at first page
- Add pagination to this following template
- split wordpress loop into columns of categories and associated posts
- Previous / Next Links For Custom Post Type Sorted By Meta_Value
- How Change URL in Pagination pagebreak no plugins wordpress?
- How is the Page Splitting implemented in the theme?
- Why the page number does not appear in splitting post?
- Use of rewind_posts() cause pagination to break
- Blog posts pagination not working
- Pagination not working in custom post type but perfectly in posts
- Paginate Images To Similate Map Drill-Down
- White screen of death on index.php page 3 and above?
- Custom pagination with URL parameters
- how to add pagination to a popular post custom page?
- Add pagination – syntax error when copy/pasting
- How to create a WordPress gallery with pagination
- Remove “Page” from Category archive
- Problem with Paging 404
- Pagination not working past page 3 on archive page of category
- Using the_posts_pagination with offset adds extra empty page
- Search, pagination, the last pages leads to 404 page
- why pagination not working in page template
- Custom pagination in wp
- Only show pagination when post count exceeds show post
- Pagination – linking back to base page – Page 1
- Custom Pagination shows same posts on each page
- Numbered pagination showing all numbers instead of paginated blocks
- Show next and previous page number
- Search pagination link redirecting to a link that doesn’t work with pagination
- Custom Query & Rewritten URL Pagination 404
- Adding pagination to query for custom page
- Main page paginate_links issue
- Custom pagination generates title 404
- Transfering static site to wordpress and retaining category by month paginations
- Removing template part when not on homepage if / else
- Paginate template name
- How to reduce the number of pages in pagination
- foreach pagination
- paged query leads to 404? [duplicate]
- Pagination only working on index page not on a template page
- Stop pagination when static homepage is set
- Is ‘pm’ used by core?