Skip Navigation

[Resolved] Different excerpt word length on mobile

This support ticket is created 3 years, 12 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 1 reply, has 2 voices.

Last updated by Minesh 3 years, 12 months ago.

Assisted by: Minesh.

Author
Posts
#2086741

I am trying to set a different word count for an excerpt depending on whether the user is viewing the view on desk top or mobile

I have a shortcode which I am using in a view (legacy views) which sets the word count for an excerpt

<p class="media-excerpt mt-3">[wpv-post-excerpt length="35" count="word" format="noautop" more="..."]</p>

This works fine on desktop but on mobile and tablet, it is too many words. Is there a way for example using conditional tags or maybe media queries where I can specify that the word count should be 10 words on mobile and tablet.

Thanks!

#2087903

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

It will require either hook, custom shrotcode or using media query. You can find the example with the following link:
=> https://stackoverflow.com/questions/22662912/showing-just-the-first-x-words-of-the-content-only-for-mobile