PHPackages                             sjmaceyful/bem-nav-walker - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. sjmaceyful/bem-nav-walker

ActiveLibrary

sjmaceyful/bem-nav-walker
=========================

v1.2.0(8y ago)3501MITPHP

Since Dec 17Pushed 8y ago1 watchersCompare

[ Source](https://github.com/sjmaceyful/bem-nav-walker)[ Packagist](https://packagist.org/packages/sjmaceyful/bem-nav-walker)[ RSS](/packages/sjmaceyful-bem-nav-walker/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (4)Used By (0)

Wordpress BEM Menu
==================

[](#wordpress-bem-menu)

[![Packagist](https://camo.githubusercontent.com/9f84afccf71ce69e3f75d40d6be43d3657afb34bc0a2f88ba255ad5561d57626/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6269636570736469676974616c2f576f726470726573732d42656d2d4d656e752e737667)](https://packagist.org/packages/bicepsdigital/class-name-parser)

Say goodbye to badly named menus in Wordpress and say hello to Wordpress BEM Menus!

**This is fork of [Wordpres-Bem-Menu](https://github.com/roikles/Wordpress-Bem-Menu), we only changed structure and added it to packagist for composer installs.**

Instalation
-----------

[](#instalation)

To use simply drop the contents of src/wp\_bem\_menu.php into your functions.php file.

Download src/wp\_bem\_menu.php and save it to your theme folder. In functions.php use include for this file.

#### Composer way

[](#composer-way)

Use cmd and navigate to your themes folder. Then use this command:

```
composer require bicepsdigital/wordpress-bem-menu

```

and don't forget to include composer's autoload from functions.php

Usage
-----

[](#usage)

First you need to register a nav menu in your themes `functions.php` file.

`register_nav_menu('my_menu', 'primary site menu');`

You also need to create a menu in wp-admin and make sure it is assigned a theme location that matches your registered nav menu above.

Then insert the following function into your theme. The first argument is the theme location (as defined in wp-admin) and the second argument is the class prefix you would like to use for this particular menu. The class prefix will be applied to the menu ``, every child `` and `` as the 'block'. The third optional argument accepts either an `array()` or a `string`.

```
