using for loop for listing posts.