Move title handling to functions.php as per wordpress theme requirements