カスタム テンプレート ファイルに、カスタム メニューの 1 つを挿入しています。
<?php wp_nav_menu( array('menu' => 'Internal' ));?>
ただし、メニューは現在の li アイテムのクラス current-menu-item を生成できません。
他のページのメニューと同じ方法で問題なくメニューを挿入しています。
Wordpress が current-menu-item の出力に失敗する原因は何ですか?
乾杯テオドール
wp_reset_query() 関数を使用してみてください。
<?php
wp_reset_query();
wp_nav_menu( array('menu' => 'Internal' ));
?>
Try to use the menu function
<?php wp_nav_menu( array('theme_location' => 'primary','menu' => 'Internal' ));?>
you will get the .current-menu-item in the li and you can make the effect accordingly