html - PHP greater than not working -
i want .icon element display when wordpress menu items greater 0, isn't working reason - displays when menu items 0.
<?php if (count($my_menu) >= 1) : ?> <a href="javascript:void(0);" class="icon">menu</a> <?php endif; ?>
try below code.
if (!empty($my_menu) && count($my_menu) >= 1) : <a href="javascript:void(0);" class="icon">menu</a> endif;
Comments
Post a Comment