As I’ve mentioned in the comment to the question, your loop is incomplete. You need while
loop to iterate through posts and the_post()
function to get those posts one by one:
<?php
// if there are posts
if ( have_posts() ) :
// iterate through all posts
while ( have_posts() ) :
// get post data
the_post();
// your post here
endwhile;
else:
// if no posts;
endif; ?>
See Codex: