1

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

    <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/上的提要显示最新帖子。有什么线索吗?

4

0 回答 0