Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I need to add this:

jQuery(window).load(function() {

Right before the closing tag of the Wordpress login page's </body> tag.
How do you do it? Would I use a combination of login_enqueue_scripts and wp_enqueue_scripts and set $in_footer to true? I'm not entirely sure how I would do that either...

share|improve this question

1 Answer 1

This is what ended up working for me: Put your script into a .js file and then:

add_action( 'login_enqueue_scripts', 'enqueue_my_script' );

function enqueue_my_script( $page ) {
    wp_enqueue_script( 'my-script', 'http://domain.com/path/myjs-file.js', null, null, true );
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.