RSS Feed未显示最新信息

时间:2018-06-18 19:19:03

标签: php wordpress rss simplepie magpie

背景故事:我有一个WordPress安装,其中核心的单个帖子/存档类型被前一个开发人员用于CPT。客户要求我为他们的博客创建一个单独的WordPress安装,我一直在使用fetch_rss将Blog帖子提供给主WP安装。两者都是不同的主题(不是我认为这是问题)。一切都很好,直到我们试图发布一篇新文章,它现在不会显示在主页上的“feed”中。我已经尝试了一些我研究的东西,它是一个缓存问题,但似乎没有解决。希望有人可以提供帮助。这是我在WordPress主网站上的Feed部分的代码:

    <div class="row">
    <style>.blog:first-of-type {border-left: 0px solid #015570;}</style>
    <?php
    include_once(ABSPATH.WPINC.'/rss.php'); // path to include script
    $feed = fetch_rss('http://www.thcenter.org/blog/feed/'); // specify feed url
    $items = array_slice($feed->items, 0, 4); // specify first and last item
    ?>

    <?php if (!empty($items)) : ?>
    <?php foreach ($items as $item) : ?>
    <div class="col-md-3 text-center blog">
        <h4 class="blog-title"><a href="<?php echo $item['link']; ?>"><?php echo $item['title']; ?></a></h4>
        <div class="teal featured-image"><p><?php echo $item['description']; ?></p></div>
        <div class="text-center breathe"><a href="<?php echo $item['link']; ?>" class="btn btn-teal">Read More</a></div>
    </div>
    <?php endforeach; ?>
    <?php endif; ?>
</div>

主要Wordpress网站:http://www.thcenter.org/ 博客安装:http://www.thcenter.org/blog/

http://www.thcenter.org/blog/feed/的Feed正在显示最新帖子。有线索吗?

0 个答案:

没有答案
相关问题