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