Added possibility to set the number of posts per page with pagination