That file name and placement looks good to me. I believe the issue is that $location is not defined.
I’d suggest by referencing this:
https://gist.github.com/cliffordp/69e9440d344e923c8f326b7ed846b04f
It’s not from the current version of our plugins but can probably give you exactly what you’re looking for.
I’d also suggest enabling WP_DEBUG and watch for errors while testing your custom code. For example, your current single-event.php will likely throw an error relating to $location being an undefined variable.
Please let me know how this goes for you.
If you need some additional coding help, you may want to ask your developer or reference our documentation and list of known customizers.