Strip images from HTML / Strings

Easy and simple:

This came handy when I had a wordpress theme that was showing on the homepage both the featured image and the image in the beginning of the post’s content and I wanted to remove the images which are part of the content.

What I did:

In content.php (the template file which shows the homepage content –

Instead of the default:

I used:

 

Leave a Reply

Your email address will not be published. Required fields are marked *