admin管理员组文章数量:1310498
I recently developed a new custom theme in wordpress. I want the following menu structure: Left menu LOGO Right menu
For example: Home About LOGO HERE Blog Contact
I created the following code:
<nav class="navbar navbar-expand-sm bg-light">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar-content" aria-controls="navbar-content" aria-expanded="false" aria-label="<?php esc_html_e( 'Toggle Navigation', 'theme-textdomain' ); ?>">
<span class="navbar-toggler-icon"></span>
</button>
<?php wp_nav_menu( array( 'theme_location' => 'left', 'menu_class' => 'navbar-nav' ) );
$custom_logo_id = get_theme_mod( 'custom_logo' );
$image = wp_get_attachment_image_src( $custom_logo_id , 'full' );
if ( has_custom_logo() ) { ?>
<a href="<?php get_home_url(); ?>">
<img src="<?php echo $image[0]; ?>" alt="">
</a>
<?php } else { ?>
<h1><?php bloginfo( 'name' ); ?></h1>
<h4><?php bloginfo( 'description' ); ?></h4>
<?php } ?>
<?php wp_nav_menu( array( 'theme_location' => 'right', 'menu_class' => 'navbar-nav' ) ); ?>
</nav>
The problem is that is not responsive.. I cannot fix it in mobile. I also tried the bootstrap-navwalker but with no results.. Can you help me?
Thank you in advance.
本文标签: customizationHow to create left and right menu with logo center in a custom theme
版权声明:本文标题:customization - How to create left and right menu with logo center in a custom theme? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741818258a2399207.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论