Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Macdonald committed Oct 20, 2015
1 parent 9ffbd49 commit de5dbc0
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,32 @@ This is a utility class that is intended to format your WordPress theme menu wit

## Installation

Place wp_bootstrap_navwalker.php in your WordPress theme folder /wp-content/your-theme/
Place yamm-nav-walker.php in your WordPress theme folder /wp-content/your-theme/

Open your WordPress themes functions.php file /wp-content/your-theme/functions.php and add the following code:
```php
// Register Custom Navigation Walker
require_once('wp_bootstrap_navwalker.php');
require_once('yamm-nav-walker.php');
```

## Usage

Update your `wp_nav_menu()` function in `header.php` to use the new walker by adding a "walker" item to the wp_nav_menu array.

```php
<?php
wp_nav_menu( array(
'menu' => 'primary',
'theme_location' => 'primary',
'depth' => 4,
'container' => 'div',
'container_class' => 'collapse navbar-collapse',
'container_id' => 'bs-example-navbar-collapse-1',
'menu_class' => 'nav navbar-nav yamm',
'fallback_cb' => 'Yamm_Nav_Walker_menu_fallback',
'walker' => new Yamm_Nav_Walker())
);
?>
<?php
wp_nav_menu( array(
'menu' => 'primary',
'theme_location' => 'primary',
'depth' => 4,
'container' => 'div',
'container_class' => 'collapse navbar-collapse',
'container_id' => 'bs-example-navbar-collapse-1',
'menu_class' => 'nav navbar-nav yamm',
'fallback_cb' => 'Yamm_Nav_Walker_menu_fallback',
'walker' => new Yamm_Nav_Walker())
);
?>
```

Your menu will now be formatted with the correct syntax and classes to implement Bootstrap dropdown navigation.
Expand Down Expand Up @@ -91,17 +91,17 @@ http://getbootstrap.com/components/#nav
You can also use the full width walker like so:

```php
<?php
wp_nav_menu( array(
'menu' => 'primary',
'theme_location' => 'primary',
'depth' => 4,
'container' => 'div',
'container_class' => 'collapse navbar-collapse',
'container_id' => 'bs-example-navbar-collapse-1',
'menu_class' => 'nav navbar-nav yamm',
'fallback_cb' => 'Yamm_Fw_Nav_Walker_menu_fallback',
'walker' => new Yamm_Fw_Nav_Walker())
);
?>
<?php
wp_nav_menu( array(
'menu' => 'primary',
'theme_location' => 'primary',
'depth' => 4,
'container' => 'div',
'container_class' => 'collapse navbar-collapse',
'container_id' => 'bs-example-navbar-collapse-1',
'menu_class' => 'nav navbar-nav yamm',
'fallback_cb' => 'Yamm_Fw_Nav_Walker_menu_fallback',
'walker' => new Yamm_Fw_Nav_Walker())
);
?>
```

0 comments on commit de5dbc0

Please sign in to comment.