The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Jquery WP issue Re: Jquery WP issue


Okay sorry it took so long to get back to you. Been a rough week. You enqueue the jquery ui, but I dont see the command to load normal jquery. This is what I have right now.

function portfolio_script_manager() {

// wp_register_script template ( $handle, $src, $deps, $ver, $in_footer );
wp_register_script(‘portfolio-scroll-bar’, get_template_directory_uri() . ‘/js/jquery.mCustomScrollbar.js’, array(‘jquery’), true, true);
wp_register_script(‘portfolio-mouse-scroll’, get_template_directory_uri() . ‘/js/jquery.mousewheel.min.js’, array(‘jquery’), true, true);
wp_register_script(‘portfolio-sticky’, get_template_directory_uri() . ‘/js/jquery.sticky.js’, array(‘jquery’), true, true);

// enqueue the scripts/styles for use in theme

// built in scripts (loaded in WP)
wp_enqueue_script (‘jquery’);
wp_enqueue_script (‘jquery-ui-core’); // UI base core, you need to load needed components individually
wp_enqueue_script (‘jquery-ui-mouse’); // UI core component –
wp_enqueue_script (‘jquery-ui-draggable’);

// custom scripts (added)

} add_action(‘wp_enqueue_scripts’, ‘portfolio_script_manager’);

Edited: Sorry so many edits if anyone is seeing this thread. It is working now! I had an issue in the header that used a different method of calling the jquery that caused them. Reworked it to work. Thanks a lot man.

I guess the only other question I have would be, is it better to just use the wp jquery/ui or would it be better to first try google cdn, and if it is not already loaded then use them.

Edit 2:

Okay. So after I signed out of wp-admin area, the sticky started working. However anytime I roll over my custom scrollbars, The error ” Uncaught TypeError: Object # has no method ‘easeOutCirc’ ” comes up.

Also, if I reload the page, everything stops working. I have to exit it and re enter the url. Is this a issue being on a local host?