我很难让“菜单”或“导航菜单”出现在标题中。
header.php中的代码
<header>
<?php if ( !is_front_page() ) : ?>
<nav role="navigation" class="site-navigation main-navigation">
<h1 class="assistive-text"><?php _e( 'Menu', 'underscoresme' ); ?></h1>
<div class="assistive-text skip-link"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'underscoresme' ); ?>"><?php _e( 'Skip to content', 'underscoresme' ); ?></a></div>
<?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>
</nav><!-- .site-navigation .main-navigation -->
<?php endif; ?>
</header>仪表板中的菜单配置

现场定制

它根本不想出现。在开发工具中检查时没有<nav>。我没有在functions.php或任何其他包含PHP代码的文件中更改任何用于使主题工作的内容。我想使用Bootstrap的导航菜单。
karnopedia.com是这个网站。
发布于 2017-10-27 15:06:37
删除!is_front_page()检查中的感叹号。您的代码工作,但没有显示在头版,因为检查。
https://stackoverflow.com/questions/46977142
复制相似问题