Bootstrap 4导航

时间:2018-08-07 20:22:26

标签: php wordpress twitter-bootstrap child-theming

我正在为Wordpress使用下划线的空白主题。香港专业教育学院尝试集成引导程序4,但即时通讯遇到导航问题。由于某些原因,导航栏不显示菜单链接。它仅显示汉堡包图标并折叠桌面上的菜单链接。我只希望将汉堡包图标显示在手机上。

这是我的php代码

<div id="page" class="site container-fluid">
<a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'sportsinthebahamas' ); ?></a>

<header id="masthead" class="site-header">
<nav id="menu" class="navbar nav-expand-md navbar-light" "role="navigation">
    <div class="site-branding navbar-brand">
        <?php
        the_custom_logo();
        if ( is_front_page() && is_home() ) :
            ?>
            <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
            <?php
        else :
            ?>
            <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
            <?php
        endif;
        $sportsinthebahamas_description = get_bloginfo( 'description', 'display' );
        if ( $sportsinthebahamas_description || is_customize_preview() ) :
            ?>
            <p class="site-description"><?php echo $sportsinthebahamas_description; /* WPCS: xss ok. */ ?></p>
        <?php endif; ?>
    </div><!-- .site-branding -->

    <button class="navbar-toggler nav-bar-toggler-right" type="button" data-toggle="collapse"
    data-target="#bs4navbar" aria-controls="bs4navbar" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
    </button>
    <?php
        wp_nav_menu([
            'menu'  => 'primary',
            'theme_location'  => 'primary',
            'container'       => 'div',
            'container_id'    => 'bs4navbar',
            'container_class' => 'collapse navbar-collapse',
            'menu_id'         => 'main-menu',
            'menu_class'      => 'navbar-nav ml-auto',
            'depth'           => 2,
            'fallback_cb'     => 'bs4navwalker::fallback',
            'walker'          => new bs4navwalker()
        ]);
        ?>
    </nav>

请帮助!因为我不太熟悉php。我还附上了屏幕截图Screenshot of the code output in html screenshot of the homepage

0 个答案:

没有答案