Skip Navigation

[Resolved] reduce the number of pagination button

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 2 voices.

Last updated by Luo Yang 1 year, 7 months ago.

Assisted by: Luo Yang.

Author
Posts
#2598103
Screenshot 2023-04-23 at 11.41.10 AM.png

Dear Sir/Madam,

Please refer to attached screenshot, how can I reduce the number of pagination number [1] [2] [3] .... [10] [11]

Below is the shortcode I add the pagination in Views

[wpv-pager-nav-links output="bootstrap" previous_next_links="true"]
#2598435

Hello,

You can follow our document to customize the pagination shortcode:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#vf-344030

For example:
[wpv-pager-nav-links step="5" ellipsis="..." reach="2"]

#2599879
Screenshot 2023-04-27 at 8.34.43 AM.png
Screenshot 2023-04-27 at 8.27.18 AM.png

Dear Luo Yang,

Is it a bug? I do follow the pagination setting from the selection page without custom modify the shortcode.

Another question is about the display output, refer to the screenshot, I change the shortcode as

[wpv-pager-nav-links step="10" ellipsis="..." reach="2"  previous_next_links="true" ]

there is no ellipsis between page button 98 99 100 101 and 102 and why the translation of previous and next are 上一頁 and 下一步?Could you please advise what keyword I should redo the translation? I didn't change translation for these two buttons.

If I don't use the output="bootstrap", then the before and after two page will be collapsed together without space. How can I add the space between them if I don't use the parameter output="bootstrap"?

#2599915

One more question, is it possible to change the step dynamically? For example if total number of logs over 2000 then I want to change the step as 20, over 3000 then step is 30, etc. Or simply I only want to show the max pagination button to 10.

#2600029

You can customize the pagination shortcode like this:
[wpv-pager-nav-links output="bootstrap" previous_next_links="true" text_for_previous_link="上一页" text_for_next_link="下一页" step="10" ellipsis="..." reach="1"]

See below test site:
Login URL: hidden link

View URL:
hidden link

Result page:
hidden link

And there isn't such kind of built-in feature to change the "step" attribute dynamically, you can add a feature request for it:
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/

Our developers will evaluate it