Skip Navigation

[Resolved] I need to set limit for wp-post-body length

This support ticket is created 6 years, 7 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)

This topic contains 4 replies, has 2 voices.

Last updated by Rostislav Avtodiychuk 6 years, 7 months ago.

Assisted by: Nigel.

Author
Posts
#669767

Tell us what you are trying to do? I need to set wp-post-body limit.
I see https://toolset.com/forums/topic/conditional-based-on-wpv-post-body-height/ but i don't understend how i can to use this shortcode?
Something like this?
[wpv-post-body view_template="None" postbodylength="50"]
Thanks for help

#671153

Nigel
Supporter

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

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

Hi there

Can you clarify what you want to achieve?

You want to output the post body, but only a certain number of characters, for example?

In this case, why not just use the post excerpt?

https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-excerpt

#675510

Thanks for the answer. I considered several options so that I could crop the output of the archives of my custom post types.
In the end I decided to use the excerpt (wpv-post-excerpt) - thats ok!

If you can easily tell me how i can to use shortcode correctly?

#677702

Nigel
Supporter

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

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

You mean how to use the post excerpt shortcode?

You would typically use the shortcode in the output of a View or a custom archive listing posts, and simply insert the shortcode (manually, by typing it, or using the Fields and Views button) in the Loop Output section (or in a connected content template).

By default the wpv-post-excerpt shortcode will limit the length to 252 characters, but you can use the shortcode attributes to, for example, set a limit of 50 words, like so:

[wpv-post-excerpt length="50" count="word"]

Post excerpts are a built-in WordPress feature you can read more about here: https://developer.wordpress.org/reference/functions/the_excerpt/

#691847

Thank you for quality help!