• Great plugin!

    Can’t solve the problem with jquery slider library though.
    I get this:
    Uncaught TypeError: jQuery(…).slider is not a function
    at HTMLDivElement.<anonymous> (front.js?ver=2.0.0:45)
    at Function.each (jquery.min.js?ver=3.6.0:2)
    at s.fn.init.each (jquery.min.js?ver=3.6.0:2)
    at HTMLDocument.<anonymous> (front.js?ver=2.0.0:2)
    at e (jquery.min.js?ver=3.6.0:2)
    at t (jquery.min.js?ver=3.6.0:2)

    I thought that some js libraries haven’t gotten loaded but this is the sequence:
    jquery.min.js
    jquery-ui.min.js?ver=2.0.0
    jquery.ui.touch-punch.min.js?ver=2.0.0
    jquery-ui-slider-pips.js?ver=2.0.0
    jquery.min.js?ver=3.6.0
    jquery-migrate.min.js?ver=3.3.2
    front.js?ver=2.0.0

    So you can see that jquery and jquery-ui along with other libraries are loaded properly and in time.

    • This topic was modified 3 years, 4 months ago by ozzy1986.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter ozzy1986

    (@ozzy1986)

    I just realized that jquery got attached twice. Removing the latter one solved the problem.

    However it’s strange that I had to remove plugin’s attachment of jquery by changing:
    wp_enqueue_script( 'OCCF7RS-front-js', OCCF7RS_PLUGIN_DIR . '/includes/js/front.js', array('jquery'), '2.0.0' );
    to
    wp_enqueue_script( 'OCCF7RS-front-js', OCCF7RS_PLUGIN_DIR . '/includes/js/front.js', array(), '2.0.0' );

    Looks like with this code jquery is loaded AFTER all other plugin’s js scripts. I wonder why and how to solve it without editing plugin’s core.

    Thanks for this topic. I have the same issue. Solved it with adding a check if jquery is alreayd loaded in the plugins code.

    if ( ! wp_script_is( 'jquery', 'enqueued' )) {
      
            //Enqueue
            wp_enqueue_script( 'jquery' );
    
          }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘jQuery(…).slider is not a function’ is closed to new replies.