Ok, I’ve got content with images removed using this code:
$content = strip_tags(get_the_content(), '<p><a><h2><blockquote><code><ul><li><i><em><strong>');
$content = preg_replace("/[caption.*[/caption]/", '', $content);
$content = str_replace("[/caption]", '', $content);
echo $content;
Now I want to show the images at the end. I’m trying to use this:
$images = strip_tags(get_the_content(), '<img>');
echo $images;
But it’s not working. Any ideas?
maybe use this regex: