Skip to content

Instantly share code, notes, and snippets.

@martynchamberlin
Created August 27, 2014 19:59
Show Gist options
  • Save martynchamberlin/f2e664bfb14c2e96ee85 to your computer and use it in GitHub Desktop.
Save martynchamberlin/f2e664bfb14c2e96ee85 to your computer and use it in GitHub Desktop.
Remove White Space Between <li> Elements in a Genesis Menu
<?php
/**
* Having `display: inline-block` works great as long as there isn't white space.
*/
add_filter('genesis_do_nav', 'remove_whitespace');
function remove_whitespace( $str )
{
$str = str_replace( "\r\n", "", $str );
$str = str_replace( "\r", "", $str );
$str = str_replace( "\n", "", $str );
return $str;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment