Hello,
I’m sorry but you can’t use php code in text widget areas. It does not work. If you need to make any changes in template files use child theme. Child theme archive you can find in theme package. How to use child theme you can read here https://codex.wordpress.org/Child_Themes
Regards