参考
http://opendream.co.jp/index.php/%E3%82%A2%E3%83%A1%E3%83%96%E3%83%AD%E3%81%AErss%E6%83%85%E5%A0%B1%E3%81%8B%E3%82%89%E3%83%AA%E3%82%B9%E3%83%88%E3%82%92%E3%82%B5%E3%82%A4%E3%83%88%E3%81%AB%E8%A1%A8%E7%A4%BA%E3%81%99%E3%82%8B/
<!-------------------------AMEBA--------------------------------->
<div id="ameba">
<div class="rss-box">
<ul class="rss-items">
<?php
$blogID = '2youngc'; // 例として さんのアメブロを表示します
$checkURL="http://ameblo.jp/";
$lenURL = strlen($checkURL) + strlen($blogID) + 1;
$blogRSS = simplexml_load_file("http://feedblog.ameba.jp/rss/ameblo/{$blogID}");
$bloglist = "" ?>
<?php
$i = 0;
$kiji = 2;//この回数でフォーチ終わる。
foreach ( $blogRSS->item as $item )
{
if($i >= $kiji)://siが3よりおおきくなったら
break;//ループおわり
else://それまではこれで出力
if( substr( $item->link, 0, $lenURL ) == "{$checkURL}{$blogID}/" ){
// 本人の投稿を判定する(広告を除去する)
$title = $item->title;
$link = $item->link;
$desc = strip_tags( $item->description );
$desc = mb_strimwidth( $desc, 0, 104, "...", "utf-8" );
$dt = date( 'Y/m/d', strtotime( $item->children('http://purl.org/dc/elements/1.1/' )->date ) );
$today = date( 'Y/m/d' );
$yesterday = date( 'Y/m/d', strtotime("-1 day") );
$bloglist .= "<li class='rss-item'>$dt ";
if ( $dt == $today || $dt == $yesterday )
{
// 当日と1日前の投稿には「NEW」を表示する
$bloglist .= "<span style=\"color:red\">NEW</span>";
} //new
$bloglist .= "<br /><a href=\"{$link}\" class='rss-item'>{$title}</a><p style='margin-top:5px; margin-bottom:3px;'>{$desc}</p></li>\n";
} //自分の記事?
$i++;//多分繰り返すごとに$iに数値が1つづ増える
endif;
} //フォーチ
//$bloglist .= "<p style='margin:0px'><a href=\"http://ameblo.jp/{$blogID}/entrylist.html\">もっと見る</a></p>";
echo $bloglist;
?>
<div style="clear:both; margin-top:5px; margin-bottom:3px;"></div>
</ul>
</div>
</div id="ame">
ワードプレス みけん
参考
http://mypacecreator.net/blog/archives/2021
<?php
//以下3行の項目を任意に変更
$display_posts_count = 5; //実際に表示したい記事件数
$get_posts_count = 10; //取得する記事件数(PR記事を含むので$display_posts_countより少し多めに設定)
$feed = fetch_feed('http://feedblog.ameba.jp/rss/ameblo/アメブロのID/rss20.xml'); //取得したいRSS
//以下は必要なければ変更しなくてOK
$counter = 0; //ループ回数カウンター
include_once(ABSPATH . WPINC . '/feed.php');
if (!is_wp_error( $feed ) ) : //エラーがなければ
$maxitems = $feed->get_item_quantity($get_posts_count); //取得件数
$feed_items = $feed->get_items(0, $maxitems); //指定件数分の配列作成
endif;
?>
<ul>
<?php
if ( $feed_items == 0 ) echo '<li>新しい記事はないようです</li>';
else foreach ( $feed_items as $item ) :
if( !preg_match('/^PR:/', $item->get_title() ) && $counter < $display_posts_count ): //PR記事の除外 && 表示件数が設定件数を超えないかチェック
?>
<li> <a href="<?php echo $item->get_permalink(); ?>"> <?php echo $item->get_title(); ?></a> <br />
<?php echo $item->get_date('Y.m.d'); ?>更新</li>
<?php $counter++;
endif;
endforeach; ?>
</ul>









