您至少可以通过两种方式实现这一点:
1) 通过CSS。使用适当的类选择器(例如当前页面项、当前页面父级、当前页面父级)显示相应的子菜单。
2) 单独调用wp\\u list\\u pages()。第一个调用将传递一个depth=1参数,第二个调用将确定当前父页的ID,并使用“child\\u of”参数相应地输出,例如:
<?php
global $post;
$current_page_parent = ( $post->post_parent ? $post->post_parent : $post->ID );
wp_list_pages( array(
\'title_li\' => \'\',
\'child_of\' => $current_page_parent,
\'depth\' => \'1\' )
);
?>
可能还有其他的方法。