generateblocks
generateblocks copied to clipboard
Add a filter to set `mid_size` of the `the_posts_pagination` in Query Loop Pagination block
Description
The customer wants to shorten pagination like this: https://prnt.sc/BpdhUHvQ0GbP
Instead of having something like this: https://prnt.sc/AGPHbPRLv_Ur
Steps for testing
- Create a Query Loop Block.
- Add Pagination
References:
... https://generate.support/topic/page-number-query-loop-too-long/#post-21539
Obviously, this isn't a fix but it does serve the same aesthetic purpose.
It hides the link after the first ...
and before the last ...
pagination links:
.gb-query-loop-pagination:has(span.page-numbers.dots + a.page-numbers:nth-child(4)) a.page-numbers:nth-child(4),
.gb-query-loop-pagination:has(span.page-numbers.dots + a.page-numbers:nth-child(4)) a.page-numbers:nth-child(8) {
display: none;
}
To visibly see what this is doing you can use the following instead:
.gb-query-loop-pagination:has(span.page-numbers.dots + a.page-numbers:nth-child(4)) a.page-numbers:nth-child(4),
.gb-query-loop-pagination:has(span.page-numbers.dots + a.page-numbers:nth-child(4)) a.page-numbers:nth-child(8) {
background: red !important;
}
Example screenshot with the targetted items having a red background (yellow is active/current):
Example screenshot with those items hidden: