Why post loop should be like
<?php if(have_posts())
{
while(have_posts())
{
the_post();
code for post here
}
}
?>
this if statement looks so unnecessary, cause while have same statement have_posts return false when dont detect any post and true when detect any post so while doesn't work if there are no posts, so why check it in dive above that while?