我已经在我博客的Rss中添加了缩略图,我正在使用这段代码在另一个网站上显示Rss。
请指导我如何将图像缩略图添加到此代码。。。
结果见:Pmanagers.org
<?php // Get RSS Feed(s)
include_once( ABSPATH . WPINC . \'/feed.php\' );
// Get a SimplePie feed object from the specified feed source.
$rss = fetch_feed( \'http://pmanagers.org/blog/feed/\' );
$maxitems = 0;
if ( ! is_wp_error( $rss ) ) :
$maxitems = $rss->get_item_quantity( 6 );
$rss_items = $rss->get_items( 0, $maxitems );
endif;
?>
<div class="headwrp">
<h4>Latest Blog posts</h4>
</div>
<ul>
<?php if ( $maxitems == 0 ) : ?>
<li><?php _e( \'No items\', \'my-text-domain\' ); ?></li>
<?php else : ?>
<?php // Loop through each feed item and display each item as a hyperlink. ?>
<div class=" owl-carousel">
<?php foreach ( $rss_items as $item ) : ?>
<div class="item">
<li id="news-single">
<a href="<?php echo esc_url( $item->get_permalink() ); ?>" target="_blank"
title="<?php printf( __( \'Posted %s\', \'my-text-domain\' ), $item->get_date(\'j F Y | g:i a\') ); ?>">
<?php echo esc_html( $item->get_title() ); ?>
</a>
</li>
</div>
<?php endforeach; ?>
<?php endif; ?>
</ul>
</div>