I can not get the jQueryUI slider to work on Wordpress. I got the following HTML structure:
<input type="text" name="TPSP[numberOfPosts]" id="numberOfPosts" value="<?php $args['options']['numberOfPosts']; ?>" /> <div id="NOP_slider"></div>ββββββββββ
And the following jQuery function:
jQuery(function($) { var numberOfPosts = AdminPageOptions.numberOfPosts; $( "div#NOP_slider" ).slider({ value:numberOfPosts, min: 0, max: 10, step: 1, slide: function( event, ui ) { $( "#numberOfPosts" ).val( ui.value ); } }); $( "#numberOfPosts" ).val( $( "#NOP_slider" ).slider( "value" ) ); })β
But Wordpress does not show div#NOP_slider as a slider, and I cannot use it. I also tried to unregister the jQueryUI owned by wordpress and register my own version, which I downloaded from the jQueryUI site, but nothing has changed. Is there a way to make it work correctly?
Thanks in advance.
source share