WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] moving scripts to footer (4 posts)

  1. artcoder
    Member
    Posted 3 years ago #

    wp_enqueue_script is putting javascripts in my head of HTML. Is it possible to make javascript for placement at the bottom of HTML page for better performance?

  2. Simon Prosser
    Theme Review Admin
    Posted 3 years ago #

    http://codex.wordpress.org/Function_Reference/wp_enqueue_script

    There is an option to load scripts into the footer.

  3. artcoder
    Member
    Posted 3 years ago #

    But for some reason, I get error ...

    Parse error: syntax error, unexpected ',' in header.php

    when I write ...

    wp_enqueue_script( 'comment-reply', , , , true );

  4. Simon Prosser
    Theme Review Admin
    Posted 3 years ago #

    if ( is_singular() ) wp_print_scripts( 'comment-reply' );

    Your milage may vary with this see: http://core.trac.wordpress.org/ticket/12641

Topic Closed

This topic has been closed to new replies.

About this Topic