custom WordPress plugin code

Hello there,

I have a WordPress site that needs a simple appointment booking section. Everything is working fine but I want to exclude Sundays from the calendar. I found this code but I don’t know where it should go. I tried placing it in the functions. Php but I get an error message. Where should it go in order to make it work correctly? Or if you have a better suggestion, I’d appreciate it.