简体   繁体   中英

Can't get navbar to work with Wordpress

Ive been struggling long time with the navbar for my wordpress Theme im developing.

I can't get it to display the navbar correctly.

Here is my code from header.php:

  <body>
  <nav class="navbar navbar-default" role="navigation">
    <div class="navbar navbar-inverse navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>

            </button>

            <a class="brand" href="<?php echo site_url(); ?>"<?php bloginfo('name'); ?></a>

          <div class="nav-collapse collapse">
             <ul class="nav">

              <?php wp_list_pages('sort_column=menu_order'); ?>

              </ul>
          </div><!--/.nav-collapse -->
        </div>
        </div>
      </div>
      </nav>    
    <div class="container">

EDIT:

Heres a link to screenshot of what I wish and what it looks like now.

在此处输入图片说明

Check this out on GitHub.

https://github.com/twittem/wp-bootstrap-navwalker

I think this will help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM