【问题标题】:wp_list_pages function not showing childrenwp_list_pages 函数不显示子项
【发布时间】:2017-10-20 20:37:33
【问题描述】:

Wordpress 自动更新到 4.6.6,我的“显示子页面的菜单”功能停止工作。我正在使用 https://github.com/Freshclicks/Fresh-Deploy 的 LEMP 堆栈上运行

我已刷新缓存,更新到 Wordpress 4.7.5,但似乎找不到问题。

我的主题侧边栏有以下代码:

<?php
if ( $post->post_parent ) {
    $children = wp_list_pages( array(
        'title_li' => '',
        'sort_column' => 'menu_order',
        'child_of' => $post->post_parent,
        'echo'     => 0
    ) );
} else {
    $children = wp_list_pages( array(
        'title_li' => '',
        'sort_column' => 'menu_order',
        'child_of' => $post->ID,
        'echo'     => 0
    ) );
}

if ( $children ) : ?>
    <ul class="nav nav-pills nav-stacked">
        <?php echo $children; ?>
    </ul>
<?php endif; ?>

这在我的本地 LAMP 堆栈和类似配置的 LEMP 堆栈上运行良好。我已经刷新了 memcached 和 nginx 缓存,重新启动了服务器,但一直无法解决这个问题。

任何想法可能导致这种情况?

【问题讨论】:

    标签: wordpress nginx php-7


    【解决方案1】:

    上面的代码没有任何问题。出现重复页面链接到错误菜单项的问题。

    【讨论】:

      猜你喜欢
      • 2012-09-03
      • 1970-01-01
      • 1970-01-01
      • 2011-04-02
      • 1970-01-01
      • 2020-01-08
      • 1970-01-01
      • 2019-08-14
      • 1970-01-01
      相关资源
      最近更新 更多