Wordpressで複数のRSSを表示

wordpressのトップページで、ポータルサイトっぽく外部の複数のRSSを表示する方法です。

下記のコードを、rss_feed.php という名前で作ります。
これを、テーマのディレクトリに置いておきます。

<?php include_once(ABSPATH . WPINC . '/feed.php');
$rss = fetch_feed( array( //blog RSS Feed
"_RSS_URL_A_",
"_RSS_URL_B_",
"_RSS_URL_C_"
)
);

if (!is_wp_error( $rss ) ) :
$rss->set_cache_duration(3600);
$rss->init();
$maxitems = $rss->get_item_quantity(20);
$rss_items = $rss->get_items(0, $maxitems);
date_default_timezone_set('Asia/Tokyo');
endif;
?>


<div id="object_rss">
<?php if ($maxitems == 0) echo 'No items.';
else
foreach ( $rss_items as $item ) : ?>
<div class="block rssbox">
<div style="width: 64px; height:64px; float:left;">
<a href="<?php echo $item->get_feed()->get_link(); ?>" target="_blank">
<img src="http://mozshot.nemui.org/shot/small? echo $item->get_feed()->get_link(); ?>" alt="<?php echo $item->get_feed()->get_title(); ?>" /></a>
</div>
<h4><a href='<?php echo $item->get_permalink(); ?>' target="_blank"><?php echo $item->get_title(); ?></a></h4>
<div class="rss_text"><?php echo $item->get_date("Y年n月j日 G時i分"); ?>
( <a href="<?php echo $item->get_feed()->get_permalink(); ?>" target="_blank"><?php echo $item->get_feed()->get_title(); ?></a> )</div>
<div class="blog_desc"><?php echo mb_strimwidth(trim(strip_tags($item->get_content())),0,100); ?></div>
<div class="clear"></div>
</div>
<?php endforeach; ?>
</div>

管理画面のテーマ編集より、index.php を表示して、適当な場所に以下のコードを挿入します。

以上で、良い筈。たぶん^^;;;;

参考にしたサイトとか・・・・・