[Resolved] How to add JS and CSS to GP

Home Forums Support [Resolved] How to add JS and CSS to GP

Home Forums Support How to add JS and CSS to GP

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #176151
    Chad

    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

    #176152
    Chad

    Well actually, I just need to know about the js files. I know what to do with css.

    Thanks, -Chad

    #176196
    Tom
    Lead Developer
    Lead Developer

    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>

    #176269
    Chad Biggs

    Thank you!

    -Chad

    #176375
    Tom
    Lead Developer
    Lead Developer

    No problem 🙂

    #311066
    Jay

    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

    #311290
    Tom
    Lead Developer
    Lead Developer

    What exactly did you add into the hook?

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.