• I am trying to run a custom script. It is showing up in Firebug, but it won’t work on the page. I currently only want it to show up on the front page, which is front-page.php.

    I have the following code in my functions.php file

    //Call jQuery
    wp_enqueue_script( 'jquery' );
    
    //Load my script for images
    if ( !is_admin() ) { // instruction to only load if it is not the admin area
       // register your script location, dependencies and version
       wp_register_script('my_script',
           get_bloginfo('template_directory') . '/js/myscript.js',
           '1.0' );
       // enqueue the script
       wp_enqueue_script('my_script');
    }

The topic ‘Can't load jQuery script’ is closed to new replies.