get_enclosure()
returns a single array location containing a SimplePie_Enclosure object. The documentation shows it this way:
if ($enclosure = $item->get_enclosure())
{
echo $enclosure->embed();
}
That uses the <embed>
tag though, which is not what you want. The documentation for the Enclosure Object Lists many methods. The one I think you want is get_link()
, so you would change your image tag code like this:
if ($enclosure = $item->get_enclosure())
{
echo "<img src=\"" . $enclosure->get_link() . "\">";
}