admin管理员组文章数量:1122832
I have a very simple question, how do I remove a menu from a WordPress site? Is there a plugin out there that can handle this or do I have to go into my theme's code and remove something from there?
I have a very simple question, how do I remove a menu from a WordPress site? Is there a plugin out there that can handle this or do I have to go into my theme's code and remove something from there?
Share Improve this question asked Aug 14, 2014 at 20:36 TomTom 1431 gold badge2 silver badges10 bronze badges1 Answer
Reset to default 0In your admin panel, go to Appearance > Menus > Manage Locations
There you make sure that none of the theme locations have a menu assigned.
Alternatively, you can modify your theme.
If you want to do that, search for calls to wp_nav_menu.
If you take theme twentyfourteen, you have 2 files: header.php and sidebar.php
in header.php the portion to update looks like
<div id="navbar" class="navbar">
<nav id="site-navigation" class="navigation main-navigation" role="navigation">
<h3 class="menu-toggle"><?php _e( 'Menu', 'twentythirteen' ); ?></h3>
<a class="screen-reader-text skip-link" href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentythirteen' ); ?>"><?php _e( 'Skip to content', 'twentythirteen' ); ?></a>
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?>
<?php get_search_form(); ?>
</nav><!-- #site-navigation -->
</div><!-- #navbar -->
Note: if you want to modify a theme, create a child theme as your modifications would be overwritten when you update the theme.
本文标签: How do I remove a menu from a theme
版权声明:本文标题:How do I remove a menu from a theme? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736289795a1928382.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论