Problem: The wpv-pager-current-page and wpv-pager-total-pages shortcodes are displaying no values when placed on an archive that only includes one page of results.
<div class="archive-page-more"> Page [wpv-pager-current-page] of [wpv-pager-total-pages] [wpv-pager-archive-prev-page] [wpml-string context="wpv-views"]<< Previous[/wpml-string] [/wpv-pager-archive-prev-page] [wpv-pager-archive-next-page] [wpml-string context="wpv-views"]Next >>[/wpml-string] [/wpv-pager-archive-next-page] </div>
Solution:
You may wrap your entire pagination section in a wpv-pagination shortcode, which will hide the entire section when there is only one page.
Or, you may add some conditional statements that will display the number 1 when only 1 page is found:
Page [wpv-conditional if="( '[wpv-pager-archive-current-page]' ne '' )" evaluate="false"]1[/wpv-conditional][wpv-pager-archive-current-page] of [wpv-conditional if="( '[wpv-pager-archive-total-pages]' ne '' )" evaluate="false"]1[/wpv-conditional][wpv-pager-archive-total-pages]
Relevant Documentation: https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-pagination
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-conditional
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 |
---|---|---|---|---|---|---|
8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - | - |
13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - | - |
Supporter timezone: America/New_York (GMT-04:00)
This topic contains 3 replies, has 2 voices.
Last updated by 7 years, 4 months ago.
Assisted by: Christian Cox.