Dear Stefan,
The code can be added to functions.php in your theme, before the ending php tag (?>) if there is one.
Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.
Regards,
Caridad