WordPress hiding Post Div

I wanted to know how to make it possible that if there is no post i would like to be able to hide the DIV that controls the latest blog post only having them appear when someone post somethign on a blog..

Somewhat like a position in joomla but in this case i am using wordpress

Related posts

Leave a Reply

2 comments

  1. Expanding on ceejyaoz’s answer

    if(have_posts())
    {
        //... do HTML in here 
    }
    

    If there aren’t posts, the HTML, and probably the div you are talking about, won’t show up. You can even use an else statement for a custom message if there are no posts.