Only display <nav> if primary_navigation is set

The contents of the menu were being conditionally displayed, but it
would display an empty `<nav>` element if the menu location wasn’t set.
This commit is contained in:
Nathan Knowler
2021-10-08 07:51:12 -05:00
committed by Nathan Knowler
parent a03f55880a
commit 824a2cc18c

View File

@@ -3,9 +3,9 @@
{{ $siteName }}
</a>
<nav class="nav-primary">
@if (has_nav_menu('primary_navigation'))
@if (has_nav_menu('primary_navigation'))
<nav class="nav-primary">
{!! wp_nav_menu(['theme_location' => 'primary_navigation', 'menu_class' => 'nav', 'echo' => false]) !!}
@endif
</nav>
</nav>
@endif
</header>