Revised pagination to take variables for the page number and how many posts per page from config.