Remove [caption] from wp_trim_words
-
I use Twenty Twelve 1.5 and WordPress 4.0. I created child theme.
I edit content.php to make my entry showing excerpt 40 words for normal post and 65 words for sticky post. So I use wp_trim_words
This is the code,
<div class="entry-summary"> <?php $content = get_the_content(); $trimmed_content = wp_trim_words( $content, 40, '...<div class="readmoretag"><a href="'. get_permalink() .'">continue reading</a></div>' ); echo $trimmed_content; ?> </div><!-- .entry-summary -->
But now my website is showing [caption] because in my post, I put image with caption in the first paragraph.
How can I remove the caption and only show text paragraph on the excerpt?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Remove [caption] from wp_trim_words’ is closed to new replies.