[Support request] Elements hook in header OR just before closing tag

Home Forums Support Elements hook in header OR just before closing tag

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1442083
    Mikko

    I was told to “..include JS file in header or just before closing </body> tag. “.

    I created element in GP Premium but I’am not sure which “hook” should I choose from drop-down list to best reflect those positions in the code.

    1. Which GP hook should I use to install the JavaScript code so it goes to “header”?

    2. Which GP hook should I use to install the JavaScript code so it goes to “just before closing </body> tag”?

    #1442141
    David
    Staff
    Customer Support

    Hi there,

    there are three core WP hooks that cover the main places to add scripts:

    WP_head – inside the <head></head> ie. header
    WP_footer – before the closing </body> tag
    WP_body_open – immediately after the opening <body> tag – commonly used for Google Tag Manager.

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