- This topic has 9 replies, 5 voices, and was last updated 3 years, 3 months ago by
David.
-
AuthorPosts
-
July 20, 2021 at 3:07 pm #1863626
Rafał
Hello,
How to change default pagination view.
For now I have: 1 2 … 4
What I want to achieve: 1 2 3 4 (and more when I will publish more – without cutting numbers)July 20, 2021 at 4:05 pm #1863670Leo
StaffCustomer SupportHi there,
Try this filter:
https://docs.generatepress.com/article/generate_pagination_mid_size/Adding PHP: https://docs.generatepress.com/article/adding-php/
Just set it to a very large number 🙂
July 21, 2021 at 1:13 am #1864093Rafał
you are the best
July 21, 2021 at 10:25 am #1865082Leo
StaffCustomer SupportThanks 🙂
March 1, 2023 at 10:03 am #2551724Ted
I tried using generate_pagination_mid_size to limit the number of pagination buttons to just 9 (including the arros), and it doesn’t seem to be working. If you take a look at https://www.thegatewaypundit.com/?query-c82e90c0-page=5 for example, you’ll see 11 pagination buttons — which is hard to get to look right on mobile. So maybe like https://www.thegatewaypundit.com/?query-c82e90c0-page=5 but remove #3 and #7 …
Is this possible with generate_pagination_mid_size or would I need to exploit a different filter?
Thanks!
March 1, 2023 at 12:15 pm #2551872Ying
StaffCustomer SupportHi Ted,
Unfortunately, GB doesn’t have such a filter to alter the pagination, but I’ve informed our developers and they will try to create a filter for this.
For now, can you try this CSS?
.gb-query-loop-pagination :is(a.gb-button.page-numbers[href*="page=3&"], a.gb-button.page-numbers[href*="page=7&"]) { display: none; }March 1, 2023 at 7:09 pm #2552096Ted
Thanks, Ying. I’ll try some CSS to hide the extra pagination buttons. I’m not sure your CSS will work on all permutations of the pagination, but it is giving me some helpful clues on how to fix this.
March 2, 2023 at 2:57 am #2552415David
StaffCustomer SupportHi there,
give this CSS a shot.
It will place the next/previous items on their own row.@media(max-width: 768px) { .gb-query-loop-pagination .gb-button { flex: 1 0 max-content; } .gb-query-loop-pagination .gb-button:first-child, .gb-query-loop-pagination .gb-button:last-child { order: -1; flex: 1 0 calc(50% - 1px); } }Does that work ?
March 2, 2023 at 10:59 am #2553154Ted
David, you are scary good at CSS. I love solving problems with CSS, and I think for now your solution might be the best option.
March 2, 2023 at 2:09 pm #2553341David
StaffCustomer SupportWell thank you 🙂
I think it’s actually possible in the block editor ( with GB 1.7 ) without CSS, but you have to love a bit of CSS.Glad to be of help
-
AuthorPosts
- You must be logged in to reply to this topic.