我可以像这样在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提要也可以做同样的事情吗?
我有一个提要,它产生像这样的股票数字。
<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>我想将此提要导入到Wordpress中,并从xml中提取内容
我找到了一个插件,看起来可以做到,但它的成本+100美元,这是一个很好的价格,但我们没有资金。
发布于 2015-03-04 05:18:23
你可以试试这个插件,它可能会满足你的需求:
https://stackoverflow.com/questions/28841827
复制相似问题