【问题标题】:Wordpress import xml feedWordpress 导入 xml 提要
【发布时间】:2024-04-16 01:55:02
【问题描述】:

我可以用这样的东西在 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 美元,这是一个不错的价格,但我们没有资金。

【问题讨论】:

    标签: xml wordpress import


    【解决方案1】:

    你可以试试这个插件,它可能满足你的需要:

    https://wordpress.org/plugins/wp-all-import/

    【讨论】: