I’m using this code :
$pageObject = get_page($page_id);
$pageImage = "";
if (preg_match('/<!--\[img\](.*?)\[img\]-->/', $pageObject->post_content, $matches)){
if (!empty($matches[1])){
$pageImage = $matches[1];
}
}
to get image url, and to show it I use :
<img class="aligncenter size-full wp-image-139" title="" src="<?php echo $pageImage; ?>" alt="" width="" height="" />
It works in chrome, firefox, opera, safari, the problem is that in IE8 the image does not showing, like it doesen’t exist, but in page source everything looks good.
Any suggestion ? Thanks.
Remove
width="" height=""from your HTML.""is interpreted as0by IE8 and thus makes the image invisible because of size 0x0.By the way you should also remove the useless
title=""andalt="".