• ColonialScrip

    (@colonialscrip)


    Hi! I’ve searched the forums for countless of hours and this one eludes me.

    When I login to my admin area my jquery-ui script works as supposed.
    When I logout from the admin area my jquery-ui script doesn’t work at all. WEIRD.

    This is how I’m loading it in my theme’s functions.php file.

    // Loads the latest jQuery version [the best way to do it - is like this]
    function my_jquery() {
    
    if (!is_admin()) {
    
    // Loads jQuery
    wp_enqueue_script('jquery');
    // Loads jQuery ui
    wp_enqueue_script('jquery-ui');
    wp_enqueue_script('jquery-effects-core');
    }
    }
    add_action('wp_enqueue_scripts', 'my_jquery'); 
    
    // Loads jQuery dependent scripts
    if ( !is_admin() ) {//disables any when logged in to admin-area
    wp_register_script('navmenu', get_bloginfo('template_url').'/scripts/navmenu.js', array('jquery'), '', true);
    }
    
    //Run script
    function run_script() {//creates function run_scripts
    if (!is_admin()) {
    //wp_enqueue_script('faq');
    wp_enqueue_script('navmenu');
    }
    }
    //Loads function run_script into wp_header
    add_action('wp_enqueue_scripts', 'run_script');
Viewing 5 replies - 1 through 5 (of 5 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Can you link the page with the issue (assuming you’re not referring to page in the dashboard)?

    Thread Starter ColonialScrip

    (@colonialscrip)

    Sure ?? Here’s the link: https://vardverket.se

    By the way I’m using wordpress 3.6

    Thanks!

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    I’m seeing a JavaScript error on that page to do with missing code for the “hoverIntent” function. That isn’t part of jQuery UI is it? Try deactivating all plugins to explore whether any could be responsible.

    Thread Starter ColonialScrip

    (@colonialscrip)

    Ok. I’ll try that. Thanks

    Thread Starter ColonialScrip

    (@colonialscrip)

    Kind of weird though

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘jquery-ui’ is closed to new replies.