Skip Navigation

[Resolved] No pagination on smartphone and tablet

This support ticket is created 6 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Nigel 6 years, 9 months ago.

Assisted by: Nigel.

Author
Posts
#628202

Hi,

is it possible to use pagination only on desktop?
For smartphone and tablet I want to just list up the CPT's without pagination.
Or do I have to create two views and display them each on desktop or smartphone?

Thanks in advance!
Kind regards,
Jef M.

#628291

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Jef

Because pagination affects what is queried and returned from the database, if you want different forms of pagination on desktop vs. other devices then you must create different Views and then display either/or depending on the device being used.

So, create one View with the pagination for desktop, and another with pagination for handheld devices (i.e. show all posts, or use infinite scroll: https://toolset.com/documentation/user-guides/views-pagination/#pagination-options).

Then insert these Views onto the relevant page.

Then wrap the wpv-view shortcodes inside wpv-conditional shortcodes which test for whether you are on a handheld device or not.

WordPress provides the function wp_is_mobile (https://developer.wordpress.org/reference/functions/wp_is_mobile/) to test devices, so you could register that function to be used inside your conditional shortcodes, as described here: https://toolset.com/documentation/user-guides/conditional-html-output-in-views/using-custom-functions-in-conditions/