如果菜单为空,我想隐藏div类“navmain2”。请参见下面的代码:
<!-- Start main navigation -->
<div class="navmain2">
<div id="logo"></div>
<!-- Gets main menu by id -->
<span></span>
<?php
wp_nav_menu( array(
\'menu\' => 11,
\'container\' =>false,
\'menu_class\' => \'nav\',
\'echo\' => true,
\'before\' => \'\',
\'after\' => \'\',
\'link_before\' => \'\',
\'link_after\' => \'\',
\'depth\' => 0,
\'walker\' => new description_walker())
);
?>
<!-- /main menu -->
<div id="klicka">Click here! Click here! Click here</div>
</div><!-- /main navigation -->-->
我有一个徽标和一个div,里面有文字
navmain2 如你所见。
问题是:
Is it possible to hide the whole navmain2 div if the wp_nav_menu is empty?