duankange2433 2014-01-09 20:26
浏览 33

将帖子从一个WordPress网站添加到另一个WordPress网站

I have a few WordPress sites I manage and I am trying to show current posts in a box on another page. The code works but will not update to the new posts. It has been stuck on the old post for quite some time now. Here is the code I am using.

                  <?php
                        $args = array(
                    'slug' => 'news',
                    'url' => 'metnews.org',
                    'type' => 'post'
        );                          
                      $news = get_transient( 'news-json' );
                      if ( $news == false ) {
                      $news = get_remote_post( $args );
                      set_transient( 'news-json', $news, 60*60*3 );
        }

               echo $news;
        ?>

Thanks.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 Vue3 大型图片数据拖动排序
    • ¥15 划分vlan后不通了
    • ¥15 GDI处理通道视频时总是带有白色锯齿
    • ¥20 用雷电模拟器安装百达屋apk一直闪退
    • ¥15 算能科技20240506咨询(拒绝大模型回答)
    • ¥15 自适应 AR 模型 参数估计Matlab程序
    • ¥100 角动量包络面如何用MATLAB绘制
    • ¥15 merge函数占用内存过大
    • ¥15 使用EMD去噪处理RML2016数据集时候的原理
    • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大