Skip to content

Instantly share code, notes, and snippets.

@iraarx
iraarx / functions.php
Last active January 22, 2019 10:51
Сustom menu with BEM classes in WordPress (in functions.php)
*-------------- Creating custom menu with BEM classes :) ----------------*/
// Change main menu parameters
add_filter( 'wp_nav_menu_args', 'filter_wp_menu_args' );
function filter_wp_menu_args( $args ) {
if ( $args['theme_location'] === 'header-menu' || 'blog-menu' ) {
$args['container'] = false;
$args['items_wrap'] = '<ul class="%2$s">%3$s</ul>';
$args['menu_class'] = 'menu__list';
}