Archived topic
The Page Number Pagination Format
5 replies · Started by Michelle on February 3, 2023
Hi there,
No offense, I don't like the fact that people can't get to a specific page number by putting it into a text field, & can only see the first 3 pages that are offered.
We tried to add a plugin to format that & I guess GP over-rode it.
Are you planning on changing that to add more options, what plugin can we use, or how can we format it?
Thanks
Michelle
Hi there,
is this for the Archive Pages ?
And what plugin did you try ? As we don't have a solution that adds an Input Field.
Hi there,
It was this one. WP-PageNavi & yes, it's for the index page, category pages, & any other archive page.
Thanks
Michelle
Ok,
so the theme uses the core navigation function and we included some filter hooks to allow certain aspects of it to be changed:
1. Change the mid_size value ie. the number of page numbers shown between next and previous:
add_filter( 'generate_pagination_mid_size','tu_increase_pagination_numbers' );
function tu_increase_pagination_numbers() {
return 3; // number of page numbers to be displayed
}
2. Change the Next / Previoius labels:
add_filter( 'generate_next_link_text', function() {
return 'Next';
} );
add_filter( 'generate_previous_link_text', function() {
return 'Previous';
} );
But if you require more from the paging nav, and the WP Navi plugin provides what you need - see here for Toms reply on how to integrate it:
https://generatepress.com/forums/topic/first-previous-next-last-navigation/#post-793257
Thanks David.
If you ever decide to make it more fancy, I like this one...
Scroll down a smidgen where the page numbers are in rounded boxes & the page is colored in blue.
Take care
If you want i have some CSS somewhere to style the themes paging nav like that. Let me know.