finished getMainPagePosts method with default sorting