0

这是 Y 代码,header.php但我不明白为什么wp_nav_menu要给我一个垂直菜单。

在此处输入图像描述

这是我的代码header.php

<div class="navbar-wrapper">

    <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="index.html"><img src="<?php bloginfo('stylesheet_directory'); ?>/assets/img/logo.png" alt="DevtechFreelancer"></a>
            </div>

            <?php
                wp_nav_menu( array(
                    'theme_location'    => 'primary',
                    'container'         => 'nav',
                    'container_class'   => 'navbar-collapse collapse',
                    'menu_class'        => 'nav navbar-nav navbar-right'
                ) );
            ?>

        </div>
    </nav>
 </div>

请帮助:我找不到此错误的解决方案。

4

1 回答 1

0

这是解决方案

<?php
                            wp_nav_menu( array(

                                'theme_location'    => 'primary',
                                'container'         => 'ul',
                                'container_class'   => 'navbar-collapse collapse',
                                'menu_class'        => 'nav navbar-nav navbar-right'

                            )   );
                        ?>
于 2017-07-05T13:25:50.447 回答