Tag Info

New answers tagged

3

A) The <!--more--> comment: Here's a one-liner: echo wp_trim_words( strip_shortcodes( strip_tags( get_the_content( '', true ) ) ), 50 ); where we use the second argument of get_the_content() to hide the teaser above the <!--more--> part in the post content. B) The <!--noteaser--> comment: Note that there exists the ...


1

Use wp_trim_words function to limit the content to a certain number of words and returns the trimmed text. Example use of wp_trim_words function. <?php $content = get_the_content(); $trimmed_content = wp_trim_words( $content, 50, NULL ); echo $trimmed_content; ?> So I added wp_trim_words function in your code to get 50 words after ...



Top 50 recent answers are included