Image Src URL shown in sidebar of other blog
http://3.bp.blogspot.com/-n2uM4ikFoG0/VBqeNaCE6RI/AAAAAAAAIbM/Kg7P3VqMO-o/s72-c/P1030561.jpg
]]>
Link in the blogpost header
href=’http://3.bp.blogspot.com/-n2uM4ikFoG0/VBqeNaCE6RI/AAAAAAAAIbM/Kg7P3VqMO-o/s1600/P1030561.jpg’
rel=’image_src’/>
]]>
later:
itemtype=’http://schema.org/BlogPosting’>
content=’http://3.bp.blogspot.com/-n2uM4ikFoG0/VBqeNaCE6RI/AAAAAAAAIbM/Kg7P3VqMO-o/s1600/P1030561.jpg’
itemprop=’image_url’/>
]]>
function catch_that_image() {
global $post, $posts;
$first_img = ”;
ob_start();
ob_end_clean();
$output = preg_match_all(‘/
$post->post_content, $matches);
$first_img = $matches [1] [0];
if(empty($first_img)){ //Defines a default image
$first_img = “/images/default.jpg”;
}
return $first_img;
}
]]>