Skip to content

Instantly share code, notes, and snippets.

@fieldoffice
Last active July 8, 2018 20:45
Show Gist options
  • Save fieldoffice/098f831c13a1caa90dd0a5001a016d9d to your computer and use it in GitHub Desktop.
Save fieldoffice/098f831c13a1caa90dd0a5001a016d9d to your computer and use it in GitHub Desktop.
Simplified WordPress Nav
<?php
$defaults = array(
'theme_location' => 'primary-menu',
'container' => 'nav',
'container_class' => 'primary-nav',
'echo' => false,
'fallback_cb' => false,
'items_wrap' => '%3$s',
'depth' => 0
);
echo strip_tags(wp_nav_menu( $defaults ), '<nav><a>');
?>
@fieldoffice
Copy link
Author

Removes ul and li markup

<nav class="primary-nav">
    <a href="#">LINK</a>
    …
</nav>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment