On my wordpress blog my images link to another page and I would like to remove that link. I’m pretty sure it can’t be done using WordPress’ hooks and I’ve been trying with preg_replace, but to no success.
So Here’s an example:
This is a
<a href="">
simple link</a>
while this is an image link<a href=""><img src=""></a>
So I only want the images’ URL to be removed, while the text one remains.
Any ideas ?
Thank you
You can use regex:
and replace with ‘1’.
You can hook the the_content filter and apply a regex with preg_replace to do that.
Here’s some info and examples on using the hook: http://codex.wordpress.org/Plugin_API/Filter_Reference/the_content