# WP_Bootstrap_Navwalker for bootstrap 4

**URL:** https://discourse.roots.io/t/wp-bootstrap-navwalker-for-bootstrap-4/9723
**Category:** sage
**Created:** 2017-06-02T10:38:01Z
**Posts:** 7

## Post 1 by @allaghi — 2017-06-02T10:38:01Z

Hi guys,  
I am wondering if there is version of WP\_Bootstrap\_Navwalker work with bootstrap 4 navbar

---

## Post 2 by @MWDelaney — 2017-06-02T13:27:43Z

I have one [here](https://github.com/thewalkergroup/walker-theme-setup/blob/master/src/wp_bootstrap4_navwalker.php) that does me ok.

---

## Post 3 by @pi_mont — 2017-06-07T22:33:52Z

Have been using this one on a few sites that are now live. Works really well.

> **[dupkey/bs4navwalker](https://github.com/dupkey/bs4navwalker)**
>
> bs4navwalker - A custom WordPress nav walker class for Bootstrap 4 (v4.0.0-beta.2) nav menus in a custom theme using the WordPress built in menu manager.

---

## Post 4 by @Andy — 2018-01-07T17:13:53Z

A slight aside, but I’m using an `add_filter( 'wp_nav_menu_items'...` to add some custom menu items and also using the dupkey/bs4navwalker code. The problem I’ve got is that the custom menu items are appearing completely outside the div/ul of the original menu.

Not sure if this is due to the walker having run before the wp\_nav\_menu\_items filter or something?

```
<div class="ml-auto">
  <ul id="menu-primary-navigation" class="navbar-nav mr-auto">
    <li id="menu-item-18" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-18 nav-item"><a href="http://test.com/locations/" class="nav-link">Locations</a></li>
    <li id="menu-item-257" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-257 nav-item"><a href="http://test.com/about/" class="nav-link">About</a></li>
  </ul>
</div>
<li>CUSTOM MENU ITEM</li>
```

Any help would be much appreciated.

---

## Post 5 by @acardillac — 2018-04-02T19:48:50Z

I admit, I’m not real savvy with this code, and could use a little guidance.  
I implemented the bs4navwalker code to my Wordpress site, and it displayed the GitHub page where I got the code from. I don’t know what I did wrong, if anything. I opened the file in Dreamweaver and it displayed errors in the code (even though I didn’t see anything wrong) Any idea what I did wrong and need to do?

---

## Post 6 by @ben — 2018-04-05T16:39:08Z

> [@The last word on Sage 9 Bootstrap 4 Navwalkers](https://discourse.roots.io/t/the-last-word-on-sage-9-bootstrap-4-navwalkers/11126):
>
> Since the question of how to add a Bootstrap 4, Sage-friendly navwalker comes up a lot in this forum, I made a Sage composer dependency to solve the problem. Now, all you need to do is include this composer package in your Sage theme and the navwalker will be available to use. Check it out: From the README: Sets up a Bootstrap 4 Navwalker for Sage 9-based themes. To install, run the following in your Sage9-based theme directory: composer require "mwdelaney/sage-bootstrap4-navwalker" I…

---

## Post 7 by @ben — 2018-04-05T16:39:11Z


