Hello,
If you use child theme you need put the code in style.css of the child theme. Please try it.
Regards, Eva Kemp.