我正在使用阿斯塔Wordpress主题和它的4个菜单的单页网站。现在我已经创建了2多个页面,但菜单不工作,因为它只属于主页。有没有办法为不同的页面设置不同的菜单?
发布于 2019-04-10 19:01:22
usually all the pages follow page.php, have a look if you have header imported in page.php, if you want a different header menu, create a different header and rename as header-pages.php, assign a different menu here as
<?php wp_nav_menu(array(
'theme_location' => 'page_menu',
'container' => false,
'depth' => 3
))
?>
add this to your functions.php by editing the existing array
register_nav_menus( array(
-------remove this, add the below code only in existing array------
'page_menu' => esc_html__( 'Page Menu', 'website' )
-------remove this, add the above code only in existing array------
));
https://stackoverflow.com/questions/55610135
复制相似问题