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:
committed by
Nathan Knowler
parent
a03f55880a
commit
824a2cc18c
@@ -3,9 +3,9 @@
|
|||||||
{{ $siteName }}
|
{{ $siteName }}
|
||||||
</a>
|
</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]) !!}
|
{!! wp_nav_menu(['theme_location' => 'primary_navigation', 'menu_class' => 'nav', 'echo' => false]) !!}
|
||||||
@endif
|
</nav>
|
||||||
</nav>
|
@endif
|
||||||
</header>
|
</header>
|
||||||
|
|||||||
Reference in New Issue
Block a user