Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/234.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 未显示为活动的子页面_Php_Css_Wordpress_Twitter Bootstrap_Parent Child - Fatal编程技术网

Php 未显示为活动的子页面

Php 未显示为活动的子页面,php,css,wordpress,twitter-bootstrap,parent-child,Php,Css,Wordpress,Twitter Bootstrap,Parent Child,我在使用Twitter引导程序制作WordPress主题时遇到了一个问题 我有两个菜单,其中一个是导航步行器,它可以正确显示并突出显示活动的帖子类别(如果选中),但是,下一个菜单用于在父页面上显示子页面,并使用代码来执行此操作(请参见代码)。它正确输出所有子页面,但不会触发正在查看的子页面菜单项上的活动,因此我无法将活动菜单项设置为任何不同的外观 <?php if ($post->post_parent) $children = wp_list_pages("title_li

我在使用Twitter引导程序制作WordPress主题时遇到了一个问题

我有两个菜单,其中一个是导航步行器,它可以正确显示并突出显示活动的帖子类别(如果选中),但是,下一个菜单用于在父页面上显示子页面,并使用代码来执行此操作(请参见代码)。它正确输出所有子页面,但不会触发正在查看的子页面菜单项上的活动,因此我无法将活动菜单项设置为任何不同的外观

<?php
if ($post->post_parent)
    $children = wp_list_pages("title_li=&child_of=" . $post->post_parent . "&echo=0");
else
    $children = wp_list_pages("title_li=&child_of=" . $post->ID . "&echo=0");
if ($children) {
    ?>  
<?php } ?></pre>
<ul class="nav nav-tabs nav-stacked uppercase">
    <li class="menu-heading"><h6>OVERVIEW</h6></li>
        <?php echo $children; ?>
</ul>

  • 概述
代码输出:

  • 概述

当页面处于活动状态时,li的类保持为空

有人知道我如何解决这个问题吗


提前谢谢

你是否使用了wp_get_nav_menu_items()函数,它更能帮助你,我不知道。我对这方面还不太熟悉。这对子页面有效吗?