You can use this function wp_trim_words()
. It allows you to format the output, and strips all the HTML tags in the content (it uses wp_strip_all_tags
).
You will have to pass post_content
as the first paramenter.
You can use this function wp_trim_words()
. It allows you to format the output, and strips all the HTML tags in the content (it uses wp_strip_all_tags
).
You will have to pass post_content
as the first paramenter.