If there is no post in category 19, how can I hide Products in html?
<div id='cssmenu'>
<ul>
<li class='active'><a href='#'><span>Home</span></a></li>
<li class='has-sub'><a href='#'><span>Products</span></a>
<ul >
<?php query_posts('showposts=5&orderby=date&cat=19'); ?>
<?php while (have_posts()) : the_post(); ?>
<a href="<?php the_permalink(); ?>" ><li><?php the_meta(meta_key); ?><?php the_title(); ?> </li></a>
<?php endwhile; ?>
</ul>
</li>
</ul>
</div>
example menu is here : http://cssmenumaker.com/menu/modern-jquery-accordion-menu
You can do something like this from server side
Using jQuery check and filter the empty product item by count of
li
elements and hide themtry this,