Since WordPress themes are usually composed of several files, the declaration should be made in the headers.php file (or wherever the
head tags of the page can be found). To edit the file, we can do so through the WordPress admin dashboard, by going to the Edit Themes page. To access the page, hover over Appearance then click on Theme Editor.
Once in the Edit Themes page look for the header.php file as seen below.
When the file loads, declare your script within the
That’s all you need to do, and the script should be loaded on any post on your WordPress website.
Thank you for reading our tutorial, we hope you learned a lot!