Archived topic
How to add JS and CSS to GP
6 replies · Started by Anonymous on February 29, 2016
How can I add JS and CSS to GP the correct way? I tried dropping the directory with the files in the GP theme folder, then add a link in the GP hooks wp_footer, but that didn't work.
Thanks,
-Chad
Well actually, I just need to know about the js files. I know what to do with css.
Thanks, -Chad
Hi Chad,
One way is to use a child theme and then enqueue the script using the wp_enqueue_script() function.
Another way is to upload your script using the Media Library and grab the File URL.
Then go to "Appearance > GP Hooks" and add it to the wp_footer hook:
<script type='text/javascript' src='URL TO YOUR SCRIPT'></script>
Thank you!
-Chad
No problem :)
Hi Tom,
I tried this method (adding media file to footer hook) and it doesn't seem to be working.
Any thoughts (other than I am an idiot?)
Jay
What exactly did you add into the hook?