Completed adding pagination to posts.