creates for loop for posts