Fixed the loop of posts/pages