• ombhikshu

    (@ombhikshu)


    Hi all,

    Hope you are doing good..

    I want to create range sliders for my wordpress page. below is the syntax, I have included for jquery-ui-slider in function.php

    wp_register_script( 'dashboard-script', get_template_directory_uri() . '/js/dashboard_script.js', array( 'jquery','jquery-ui-core','jquery-ui-slider' ), '1.0', true );
    wp_enqueue_script('dashboard-script');

    Now in dashboard_script.js file $('#div_id').slider(); is not working.

    What i am missing. could anyone please guide me.:)

    I am developing my website in localhost.

Viewing 1 replies (of 1 total)
  • 1. Check if your page source if the script was called
    if didn’t { used this to add your script in header or change wp_footer to show it in footer }

    function scripts(){
    wp_register_script( 'dashboard-script', get_template_directory_uri() . '/js/dashboard_script.js', array( 'jquery','jquery-ui-core','jquery-ui-slider' ), '1.0', true );
    wp_enqueue_script('dashboard-script');
    }
    add_action('wp_head', 'scripts');

    if YES { then, make sure that the id of the slider is exists or not }

Viewing 1 replies (of 1 total)
  • The topic ‘How to enqueue jquery ui slider’ is closed to new replies.