我有這樣的代碼生成一個WP菜單:加入「開」狀態,WordPress的菜單
<div id="menu">
<?php $args = array(
'depth' => 1,
'show_date' => '',
'date_format' => get_option('date_format'),
'child_of' => 0,
'exclude' => '426, 508',
'include' => '',
'title_li' => __(''),
'echo' => 1,
'authors' => '',
'sort_column' => 'menu_order, post_title',
'link_before' => '',
'link_after' => '',
'walker' => ''); ?>
<ul><div class="menu-button"><?php wp_list_pages($args, 'sort_column=menu_order'); ?></div></ul>
</div>
我有一些CSS向菜單項的懸停狀態,但有可能表現出「上「狀態,如果用戶在該實際頁面上,菜單項是不同的顏色?
它與'.current_page_item'一起使用,但我也有一些我想顯示爲「on」狀態的子頁面,他們建議'.current_page_parent'或'.current_page_ancestor',但都不起作用! – Rob 2011-06-08 13:08:14
祖先工作,我的錯! – Rob 2011-06-08 14:18:40