Skip to main content
added 353 characters in body
Source Link
dadra
  • 33
  • 2
  • 3
  • 10

I have successfully been using jpanelmenu in my wordpress themes for some time, loading jquery from the google api, like this:

if ( !is_admin() ) {

    // jQuery
    wp_deregister_script('jquery');
    wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"), false);
    wp_enqueue_script('jquery');

    // load jPanelMenu
    wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js");

}

I'd rather use the version of jquery that comes included with wordpress, but can't figure out how to make that happen. Can anyone advise me on how to do that, or tell me if I'm wrong in thinking that using wp's built-in jquery would be better than what I'm doing in the code above?

I am instantiating jpanelmenu like this:

$(document).ready(function () {
    var jPM = $.jPanelMenu({
    duration: 100,
    openPosition: "240px",
    direction: "left",
    keyboardShortcuts: false
    });
    jPM.on(); // turn on jPanelMenu
});

Thanks in advance!

edited

Based on the answers below I tried the following, but jpanelmenu would not function (clicking on the menu trigger does not reveal the off-canvas menu):

function wpa_132328_enqueue_scripts(){
if ( !is_admin() ) {

        // jQuery
        wp_enqueue_script('jquery');

        // load jPanelMenu
        wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js");

    }
}
add_action( 'wp_enqueue_scripts', 'wpa_132328_enqueue_scripts' );

and

if ( !is_admin() ) {

    // jQuery
    wp_enqueue_script('jquery');

    // load jPanelMenu
    wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js");

}

and

wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js", array('jquery') );

and

if ( !is_admin() ) {

    wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js", array('jquery') ); 

}

I have successfully been using jpanelmenu in my wordpress themes for some time, loading jquery from the google api, like this:

if ( !is_admin() ) {

    // jQuery
    wp_deregister_script('jquery');
    wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"), false);
    wp_enqueue_script('jquery');

    // load jPanelMenu
    wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js");

}

I'd rather use the version of jquery that comes included with wordpress, but can't figure out how to make that happen. Can anyone advise me on how to do that, or tell me if I'm wrong in thinking that using wp's built-in jquery would be better than what I'm doing in the code above?

Thanks in advance!

edited

Based on the answers below I tried the following, but jpanelmenu would not function:

function wpa_132328_enqueue_scripts(){
if ( !is_admin() ) {

        // jQuery
        wp_enqueue_script('jquery');

        // load jPanelMenu
        wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js");

    }
}
add_action( 'wp_enqueue_scripts', 'wpa_132328_enqueue_scripts' );

and

if ( !is_admin() ) {

    // jQuery
    wp_enqueue_script('jquery');

    // load jPanelMenu
    wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js");

}

and

wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js", array('jquery') );

and

if ( !is_admin() ) {

    wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js", array('jquery') ); 

}

I have successfully been using jpanelmenu in my wordpress themes for some time, loading jquery from the google api, like this:

if ( !is_admin() ) {

    // jQuery
    wp_deregister_script('jquery');
    wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"), false);
    wp_enqueue_script('jquery');

    // load jPanelMenu
    wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js");

}

I'd rather use the version of jquery that comes included with wordpress, but can't figure out how to make that happen. Can anyone advise me on how to do that, or tell me if I'm wrong in thinking that using wp's built-in jquery would be better than what I'm doing in the code above?

I am instantiating jpanelmenu like this:

$(document).ready(function () {
    var jPM = $.jPanelMenu({
    duration: 100,
    openPosition: "240px",
    direction: "left",
    keyboardShortcuts: false
    });
    jPM.on(); // turn on jPanelMenu
});

Thanks in advance!

edited

Based on the answers below I tried the following, but jpanelmenu would not function (clicking on the menu trigger does not reveal the off-canvas menu):

function wpa_132328_enqueue_scripts(){
if ( !is_admin() ) {

        // jQuery
        wp_enqueue_script('jquery');

        // load jPanelMenu
        wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js");

    }
}
add_action( 'wp_enqueue_scripts', 'wpa_132328_enqueue_scripts' );

and

if ( !is_admin() ) {

    // jQuery
    wp_enqueue_script('jquery');

    // load jPanelMenu
    wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js");

}

and

wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js", array('jquery') );

and

if ( !is_admin() ) {

    wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js", array('jquery') ); 

}
added 67 characters in body
Source Link
dadra
  • 33
  • 2
  • 3
  • 10

WhenI have successfully been using jpanelmenu in my wordpress themes I've beenfor some time, loading jquery from the google api, like this:

if ( !is_admin() ) {

    // jQuery
    wp_deregister_script('jquery');
    wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"), false);
    wp_enqueue_script('jquery');

    // load jPanelMenu
    wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js");

}

But I'd rather use the version of jquery that comes included with wordpress, but can't figure out how to make that happen. Can anyone advise me on how to do that, or tell me if I'm wrong in thinking that using wp's built-in jquery would be better than what I'm doing in the code above?

Thanks in advance!

edited

Based on the answers below I tried the following, but jpanelmenu would not function:

function wpa_132328_enqueue_scripts(){
if ( !is_admin() ) {

        // jQuery
        wp_enqueue_script('jquery');

        // load jPanelMenu
        wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js");

    }
}
add_action( 'wp_enqueue_scripts', 'wpa_132328_enqueue_scripts' );

and

if ( !is_admin() ) {

    // jQuery
    wp_enqueue_script('jquery');

    // load jPanelMenu
    wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js");

}

and

wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js", array('jquery') );

and

if ( !is_admin() ) {

    wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js", array('jquery') ); 

}

When using jpanelmenu in my wordpress themes I've been loading jquery from the google api, like this:

if ( !is_admin() ) {

    // jQuery
    wp_deregister_script('jquery');
    wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"), false);
    wp_enqueue_script('jquery');

    // load jPanelMenu
    wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js");

}

But I'd rather use the version of jquery that comes included with wordpress. Can anyone advise me on how to do that, or tell me if I'm wrong in thinking that using wp's built-in jquery would be better than what I'm doing in the code above?

Thanks in advance!

edited

Based on the answers below I tried the following, but jpanelmenu would not function:

function wpa_132328_enqueue_scripts(){
if ( !is_admin() ) {

        // jQuery
        wp_enqueue_script('jquery');

        // load jPanelMenu
        wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js");

    }
}
add_action( 'wp_enqueue_scripts', 'wpa_132328_enqueue_scripts' );

and

if ( !is_admin() ) {

    // jQuery
    wp_enqueue_script('jquery');

    // load jPanelMenu
    wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js");

}

and

wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js", array('jquery') );

and

if ( !is_admin() ) {

    wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js", array('jquery') ); 

}

I have successfully been using jpanelmenu in my wordpress themes for some time, loading jquery from the google api, like this:

if ( !is_admin() ) {

    // jQuery
    wp_deregister_script('jquery');
    wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"), false);
    wp_enqueue_script('jquery');

    // load jPanelMenu
    wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js");

}

I'd rather use the version of jquery that comes included with wordpress, but can't figure out how to make that happen. Can anyone advise me on how to do that, or tell me if I'm wrong in thinking that using wp's built-in jquery would be better than what I'm doing in the code above?

Thanks in advance!

edited

Based on the answers below I tried the following, but jpanelmenu would not function:

function wpa_132328_enqueue_scripts(){
if ( !is_admin() ) {

        // jQuery
        wp_enqueue_script('jquery');

        // load jPanelMenu
        wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js");

    }
}
add_action( 'wp_enqueue_scripts', 'wpa_132328_enqueue_scripts' );

and

if ( !is_admin() ) {

    // jQuery
    wp_enqueue_script('jquery');

    // load jPanelMenu
    wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js");

}

and

wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js", array('jquery') );

and

if ( !is_admin() ) {

    wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js", array('jquery') ); 

}
posted various solutions suggested in answers to show what I tried
Source Link
dadra
  • 33
  • 2
  • 3
  • 10

When using jpanelmenu in my wordpress themes I've been loading jquery from the google api, like this:

if ( !is_admin() ) {

    // jQuery
    wp_deregister_script('jquery');
    wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"), false);
    wp_enqueue_script('jquery');

    // load jPanelMenu
    wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js");

}

But I'd rather use the version of jquery that comes included with wordpress. Can anyone advise me on how to do that, or tell me if I'm wrong in thinking that using wp's built-in jquery would be better than what I'm doing in the code above?

Thanks in advance!

edited

Based on the answers below I tried the following, but jpanelmenu would not function:

function wpa_132328_enqueue_scripts(){
if ( !is_admin() ) {

        // jQuery
        wp_enqueue_script('jquery');

        // load jPanelMenu
        wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js");

    }
}
add_action( 'wp_enqueue_scripts', 'wpa_132328_enqueue_scripts' );

and

if ( !is_admin() ) {

    // jQuery
    wp_enqueue_script('jquery');

    // load jPanelMenu
    wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js");

}

and

wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js", array('jquery') );

and

if ( !is_admin() ) {

    wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js", array('jquery') ); 

}

When using jpanelmenu in my wordpress themes I've been loading jquery from the google api, like this:

if ( !is_admin() ) {

    // jQuery
    wp_deregister_script('jquery');
    wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"), false);
    wp_enqueue_script('jquery');

    // load jPanelMenu
    wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js");

}

But I'd rather use the version of jquery that comes included with wordpress. Can anyone advise me on how to do that, or tell me if I'm wrong in thinking that using wp's built-in jquery would be better than what I'm doing in the code above?

Thanks in advance!

When using jpanelmenu in my wordpress themes I've been loading jquery from the google api, like this:

if ( !is_admin() ) {

    // jQuery
    wp_deregister_script('jquery');
    wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"), false);
    wp_enqueue_script('jquery');

    // load jPanelMenu
    wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js");

}

But I'd rather use the version of jquery that comes included with wordpress. Can anyone advise me on how to do that, or tell me if I'm wrong in thinking that using wp's built-in jquery would be better than what I'm doing in the code above?

Thanks in advance!

edited

Based on the answers below I tried the following, but jpanelmenu would not function:

function wpa_132328_enqueue_scripts(){
if ( !is_admin() ) {

        // jQuery
        wp_enqueue_script('jquery');

        // load jPanelMenu
        wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js");

    }
}
add_action( 'wp_enqueue_scripts', 'wpa_132328_enqueue_scripts' );

and

if ( !is_admin() ) {

    // jQuery
    wp_enqueue_script('jquery');

    // load jPanelMenu
    wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js");

}

and

wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js", array('jquery') );

and

if ( !is_admin() ) {

    wp_enqueue_script('jpanelmenu', get_bloginfo('template_directory') . "/js/jquery.jpanelmenu.js", array('jquery') ); 

}
Source Link
dadra
  • 33
  • 2
  • 3
  • 10
Loading