Added getPages() function to function.php