Ideally that code should be placed only once into a custom functions plugin. It appears that you’ve copied and pasted the code into the themes functions.php file twice and that’s resulted in a fatal error.