我可以使用类似的东西在Wordpress中导入和RSS提要。
<ul><?php if(function_exists('fetch_feed')) {
include_once(ABSPATH . WPINC . '/feed.php'); // Includes the necessary files
$feed = fetch_feed('http://computingondemand.com/news/?feed=rss'); // URL to the feed you want to show
$limit = $feed->get_item_quantity(10); // How many items you wish to display
$items = $feed->get_items(0, $limit); // 0 is start and limit is noted above
}
if ($limit == 0) echo '<div>The feed is either empty or unavailable.</div>';
else foreach ($items as $item) : ?>
<li>
<div>
<a href="<?php echo $item->get_permalink(); ?>" title="<?php echo $item->get_date('j F Y @ g:i a'); ?>"><?php echo $item->get_title(); ?></a>
</div>
<div>
<?php echo substr($item->get_description(), 0, 400); ?>
<p><a href="<?php echo $item->get_permalink(); ?>">[Read More...]</a></p>
</div>
</li>
<?php endforeach; ?><ul>
是否可以使用xml feed执行相同类型的操作。
我有一个饲料可以生成这样的股票数据。
<stockquotes>
<Ric>NXT.L</Ric>
<Currency>GBX</Currency>
<CurrentPrice>7,420.00</CurrentPrice>
<Change>-90.00</Change>
<Time>4:35 PM</Time>
<High>7,560.00</High>
<Low>7,415.00</Low>
<Open>7,530.00</Open>
<Close>7,420.00</Close>
<Bid>7,400.00</Bid>
<Ask>7,565.00</Ask>
<Volume>236,611</Volume>
<MarketCapitalMillion>1,134,321.79</MarketCapitalMillion>
<MarketCapitalBillion>1,134.32</MarketCapitalBillion>
<arrow>down</arrow>
</stockquotes>
我想将此Feed导入Wordpress并从xml中提取内容
我找到了一个看起来可以做到这一点的插件,但是花费+ 100美元,这是一个很好的价格,但我们没有资金。