views:

31

answers:

2

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

A: 

You can use the have_posts() function to detect whether there are any posts in the loop, and do conditionals based on that.

ceejayoz
A: 

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.

Chacha102