Skip to content

Instantly share code, notes, and snippets.

@eyecandy91
Last active September 4, 2019 07:20
Show Gist options
  • Save eyecandy91/db3e71eb1c78ceb51e6678542a4f679f to your computer and use it in GitHub Desktop.
Save eyecandy91/db3e71eb1c78ceb51e6678542a4f679f to your computer and use it in GitHub Desktop.
add new class to wp nav menu
<?php
echo str_replace( '<li class="', '<li class="myclass ',
wp_nav_menu(
array(
'theme_location' => 'menu-1',
'container' => 'ul',
'menu_class' => 'nav nav-pills justify-content-center d-flex align-items-center justify-content-between',
'echo' => false
)
)
);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment