Images are embedded in post content as pretty much straight HTML.
<a href="http://192.168.1.10/wp_release/wp-content/uploads/2011/01/boat.jpg">
<img src="http://192.168.1.10/wp_release/wp-content/uploads/2011/01/boat.jpg?w=300" alt="" title="boat" class="size-medium wp-image-544" height="198" width="300">
</a>
There is no easy way to alter that. You can alter it, but it means regex
ing the post body content or using an html parser like Simple HTML DOM Parser
(Not an endorsement, just an example).
The regex
way would look something like this:
function replace_image_link_cb_101524($match) {
global $post;
if (!empty($match[2])) {
$match[0] = preg_replace('|'.$match[1].'|',get_permalink($post),$match[0],1);
}
return $match[0];
}
function replace_image_link_101524($content) {
if (is_archive()) {
$pattern = '|<a.*?href="(.*)".*>?(<img.*?/?>)(?:</a>)?|';
$content = preg_replace_callback($pattern,'replace_image_link_cb_101524',$content);
}
return $content;
}
add_filter('the_content','replace_image_link_');
That well could be buggy. regex
on markup is tricky at best.