Added a pagination method to easily render pagination links for posts page