Hello @faisal44,
Except when working with a child theme (https://wpastra.com/docs/install-astra-child-theme/), do not make any changes to the theme core file. I would highly suggest following this article https://www.wpbeginner.com/plugins/how-to-add-header-and-footer-code-in-wordpress/.
I hope that this information has been helpful and clear. Have a wonderful day ahead of you.
Hi @faisal44, sorry for the delay.
Adding or modifying the theme’s code directly is not recommended as it will get wiped off when the theme is updated. And it looks like that’s what you’ve done.
This doc should help you to avoid the thing like you explained above. Or you can also use the plugin mentioned in the article shared by @fahimmurshed above. Thanks for sharing Fahim 🤝
Let us know if you need more help, otherwise please mark the topic as Resolved.
Kind regards,
Herman 🙂