I searched for all kind of solution but i really could find one that did what i was looking for, what i simple want done is wrapping all images inside a div element, old post aswell as new posts. All help is very much appreciated
p.s.
I did a little jquery snippet but I really would like another solution
the jquery code
<script>
$(function(){
$('a:has(img.postthumbimage)').wrap('<div class="myphoto" />');
});
</script>
Try using PHP’s regular expression find/replace functionâ
preg_replace()
âin a filter on thethe_content
hook.Note that this will only affect images inside post content.
If you want to wrap images that occur outside of the post body (such as featured images or images in custom fields), the most efficient way is probably to find where they occur and add the div wrapper to your theme file.