Adding a slider into WordPress

How can I get a slider in HTML? Actually, how can I get a slider in WordPress, which is slightly harder? jQuery UI provides a slider, but the jQuery that ships with WordPress was not appearing for me. I tried using the jQuery provided by Google’s CDN instead:

<link rel="stylesheet" href="">
wp_register_script('jquery', "", false);
wp_register_script('jqueryui', "", false);

There are probably later versions I could be grabbing.

Then I embedded a Javascript file into my post which created a slider div:

jQuery(function() {
      value: 100,
      min: 0,
      max: 500,
      step: 50,
      slide: function(event, ui) {
        // insert event-handling code here

// Add a div which will hold the slider.
document.write('<div id="slider"></div>');

This file produces the following slider:

And I’m satisfied.


Leave a Reply

Your email address will not be published. Required fields are marked *