RSS Feed Shows NULL When Asking For Thumbnail
I am pulling in posts from separate WP installs on separate URLs. I have everything I want except for the thumbnail. My theme supports thumbnails but when I ask for the thumbnail it is showing me NULL. Anyone know why this may be happening? When I var_dump($item)
it shows NULL for my thumbnails. All my posts on that sep. URL do have a featured image.
functions.php
add_theme_support( 'post-thumbnails' );
The RSS Page
?php
include_once(ABSPATH . WPINC . '/feed.php');
$rss = fetch_feed(PATH_TO_MY_URL);
if(!empty($rss)):
$maxitems = $rss-get_item_quantity(4);
$rss_items = $rss-get_items(0, $maxitems);
endif;
?
?php
if ($maxitems == 0) :
echo 'No News.';
else :
foreach ( $rss_items as $item ) : ?
div class="post-block"
figure
a href="#"
?php
if ($enclosure = $item-get_enclosure()) :
echo $enclosure-get_thumbnail();
endif;
?
/a
/figure
h3 class="mbs"a target="_blank" href="?php echo $item-get_permalink(); ?" class="link-color-1"?php echo $item-get_title(); ?/a/h3
?php echo $item-get_description(); ?
a target="_blank" href="?php echo $item-get_permalink(); ?" class="btn mtxs btn-sm btn-color-3"Read Full Article nbsp;i class="fa fa-angle-double-right"/i/a
/div
?php endforeach; ?
?php endif; ?