WordPress.org

Ready to get started?Download WordPress

Forums

Javascript in footer (3 posts)

  1. Felice Guerriero
    Member
    Posted 2 years ago #

    Salve a tutti,

    ho lanciato Google Speed Test sul mio sito quellichelafarmacia.com ed ho notato che ho circa 1.1 mb di condice javascript che viene caricato.
    Come posso fare a spostarlo nel footer? Ho già provato alcuni plugin ma senza successo (Ad esempio Head Cleaner mi fa sparire i banner posizionati con Google DFS)

    Grazie mille
    ------------------------
    Hi all,

    I launched Google Speed ​​Test quellichelafarmacia.com on my site and I noticed that I have about 1.1 mb of JavaScript code that is loaded.
    How do I move it in the footer? I already tried some plugins but without success (eg Head Cleaner makes me disappear banner placed with Google DFS)

    thank you very much

  2. samateo
    Member
    Posted 2 years ago #

    If a plugin or theme is using wp_enqueue_script() to output js, the last parameter $in_footer can be set to true and the js will be output in the footer (default is false).

    Keep in mind that some plugins may require javascript be loaded before the footer in order to work properly.

  3. Felice Guerriero
    Member
    Posted 2 years ago #

    I can not figure out how to move the javascript code to link facebook etc.

Topic Closed

This topic has been closed to new replies.

About this Topic