Good morning board. As if I wasn't bald enough already, I'm trying to modify my blogs and coming across a problem...
At the moment I have a lot of posts with thumbnail images that, when clicked, just are linked to themselves i.e. bringing up that image in a new window. What I'm after is a way of modifing wordpress so that when the image is clicked, the clicker gets sent to a specific URL.
I have found the regex that selects the <a href... through to the /a> and can change it but I need a way to keep the <img src...> the same.
Allegedly the code below in your template can be used to remove the img src - can it be modified to change the a href but keep the img src?
PHP Code:
<?php
$content = get_the_content();
$postOutput = preg_replace('/<img[^>]+./','', $content);
echo $postOutput;
?>
Any thoughts?
Cheers
M.