How can I pull media:thumbnail from an RSS feed with SimplePie and fetch_feed()? How can I pull media:thumbnail from an RSS feed with SimplePie and fetch_feed()? wordpress wordpress

How can I pull media:thumbnail from an RSS feed with SimplePie and fetch_feed()?


Aaand, after pulling my hair out, it's because I forgot to include the Media RSS namespace in my custom feed. I simply included it in my opening <rss> tag and it worked:

<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss">


There is another way to solve this. I had a similar problem. I realized I had not used media:thumbnail but only media:content. In order to get the link I used the following code:

echo '<img src="' . $enclosure->get_link() . '" class="feed-thumb" />';

Instead of calling for the thumbnail, I called for the link and the situation was solved.