<?php // Get RSS Feed(s)
include_once(ABSPATH . WPINC . '/rss.php');//引入 MagpieRSS 类
$rss1 = fetch_rss('http://export.arxiv.org/rss/hep-th');//在这添加所要调用网站的Feed地址
$rss2 = fetch_rss('http://export.arxiv.org/rss/gr-qc');//在这添加所要调用网站的Feed地址
$maxitems = 30;//30代表显示30个最新文章
$items1 = array_slice($rss1->items, 0, $maxitems);
$items2 = array_slice($rss2->items, 0, $maxitems);
?>
<ul>
<main id="main" class="site-main" role="main">//为了使用自己主题的css而使用了这句。可删除
hep-th updates on arXiv.org//可按需修改
<?php if (empty($items1)) echo 'No items';
else
foreach ( $items1 as $item1 ) : ?>
<li>
<a href='<?php echo $item1['link']; ?>'
title='<?php echo $item1['title']; ?>' target="_blank" style="color:#ffffff">//颜色可按需修改
<?php echo mb_strimwidth($item1['title'] , 0, 80, '…') ; ?>
</a>
</li>
<?php endforeach; ?>
gr-qc updates on arXiv.org
<?php if (empty($items2)) echo 'No items';
else
foreach ( $items2 as $item2 ) : ?>
<li>
<a href='<?php echo $item2['link']; ?>'
title='<?php echo $item2['title']; ?>' target="_blank" style="color:#ffffff">
<?php echo mb_strimwidth($item2['title'] , 0, 80, '…') ; ?>
</a>
</li>
<?php endforeach; ?>
</main>
</ul>