Added sorting and limited the number of pages on posts.