Hey,
I’m working on a WordPress custom theme blog homepage. I want to have an image for each post that is taken from a thumbnail image and want to have the first paragraph/cut off after say 200 characters and display ‘…’. I’m aware that you can do this with:
<?php the_content('Read on...'); ?>
However, I want to also strip out any images that appear in the post. Which I am currently using the following PHP to do:
<?php
$content = strip_shortcodes($post->post_content);
$content = str_replace(']]>', ']]>', $content);
$content = strip_tags($content);
$content = apply_filters('the_content', $content);
echo $content;
?>
Is there a way I can combine the two to keep a word count AND remove any images in the_content();?
Many thanks!