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

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -