WordPress.org

Ready to get started?Download WordPress

Forums

Loading Custom JQuery code on the WordPress Login Page (wp-login.php) (4 posts)

  1. phatpat10
    Member
    Posted 1 year ago #

    Does anyone know why my custom Jquery code isn't working on the wp-login.php page. Alls I need is a few simple lines of code, but it doesn't seem to load when I try to execute it. Thank you.

  2. linux4me2
    Member
    Posted 1 year ago #

    You don't provide a link to your site or show the code you're using, so there's no way to give you a specific suggestion.

    You might try using Firefox with the Firebug extension. It's great for debugging javascript. You may just have a simple error in the JQuery you added that's preventing it from running; Firebug will tell you where to look.

  3. phatpat10
    Member
    Posted 1 year ago #

    It looks like it conflicts with other plugins etc. and has to be set up to add your own custom coding, but I found a JQuery noConflict Wrapper that can be placed around some of your code to wrork:

    jQuery(document).ready(function($) {
        // $() will work as an alias for jQuery() inside of this function
    });
  4. jcow
    Member
    Posted 10 months ago #

    Just a note, it doesn't look like jQuery is actually loaded on the log in page.

    Force jQuery to be loaded on the log in page:

    add_action( 'login_enqueue_scripts', 'custom_login_enqueue_scripts' );
    function custom_login_enqueue_scripts()
    {
    	wp_enqueue_script('jquery');
    }

Topic Closed

This topic has been closed to new replies.

About this Topic