Forums

Script between wp_footer() and /body (2 posts)

  1. Lersz
    Member
    Posted 3 months ago #

    So, I have a jQuery plugin in a .js file which I have enqueued and placed into footer. I want to put the initialization of that plugin straight to the template file (<script>*js*</script>). This can't work if the wp_footer() is placed just before the ending body tag as the piece of code that initializes the plugin has to come after the plugin source file. This is resolved by putting the initialization code after wp_footer(). Can it cause any problems if there's something between the wp_footer() and </body>? Thanks.

  2. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 3 months ago #

    It shouldn't. wp_footer is, in part, there for you to hook into and add your JS too :)

Reply

You must log in to post.

About this Topic