Moved pagination from front page to functions file