Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davechu/51c5afceede164cddb4e to your computer and use it in GitHub Desktop.
Save davechu/51c5afceede164cddb4e to your computer and use it in GitHub Desktop.
For Maira. This goes in functions.php of your theme, or possibly in a plugin. If you took out the "theme_location" qualifier, it could affect all menus.
add_filter( 'wp_nav_menu_args', 'dc_modify_nav_menu_args' );
function dc_modify_nav_menu_args( $args )
{
if ( 'primary' == $args['theme_location'] ) {
$args['link_before'] = '<span>';
$args['link_after'] = '</span>';
}
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment