Highlight the first page pagination_links

Are you looking for something like this? You need to add style for the class .current also current page number wrapper in span you can also use this to style. <span class=”page-numbers current”>1</span> <a class=”page-numbers” href=”#page2″>2</a> <a class=”next page-numbers” href=”#page2″>Next »</a> When you go to page 2 structure become <a class=”prev page-numbers” href=””>« Previous</a> <a … Read more

Include a leading zero in pagination

When your code gets to the point of outputing a number, adjust the number ($pagenumber in this code example) to include leading spaces with a variation on this $pagenumber = 123; echo sprintf(“%’.09d\n”, $pagenumber); will output 000000123 See the manual: https://www.php.net/manual/en/function.sprintf.php , example 2, and other examples in there.

Pagination doesn’t function properly for archive of a custom post type set as the front page

Between my phone and work some errors creeped in, sorry about that. here is my revised answer. Hope this helps in solving your problem. PROBLEM 1 You should not name your template ‘archive-{$post_type}.php’ if it is a page template. This totally goes against the template hierarchy for pages, and that is why your static frontpage … Read more

Pagination Not Working on `WP_Query` Archive Page

Note that with a custom WP_Query class instance like the $homePageArticles in your case, you should pass the max_num_pages property of the class instance to paginate_links(): paginate_links( array( ‘total’ => $homePageArticles->max_num_pages, ) ) However, that alone will not work with custom offset which breaks the pagination, hence for example you got this issue: it just … Read more

paginate_links() don’t properly work in search.php?

I’m fairly certain this is answered elsewhere, but I’ll add it here again. I believe your issue lies here: ‘current’ => max( 1, get_query_var(‘paged’) ), Try this instead: global $wp_query; $wp_query->query_vars[‘paged’] > 1 ? $current = $wp_query->query_vars[‘paged’] : $current = 1; …then: ‘current’ => $current; Your ‘base’ may also be an issue. Instead of this: … Read more