jQuery UI Sortable not Working With Metabox

So, after an annoyingly long struggle, I discovered that I needed to have the script enqueued/registered with no dependencies. So in the end, to make it work, I needed this: function add_admin_scripts( $hook ) { global $post; wp_register_script( ‘sectioned_page_script’, get_stylesheet_directory_uri() . ‘/js/sectioned_page.js’ ); if ( $hook == ‘post-new.php’ || $hook == ‘post.php’ ) { if …

Read more

How to load jquery ui autocomplete combobox?

Try to load the script in the footer section. <script type=”text/javascript” src=”http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js”></script> <script type=”text/javascript” src=”https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js”></script> <script type=”text/javascript”> $(document).ready(function(){ $(“#clientAutocomplete”).autocomplete({ source:’client_autocomplete.php’, minLength:1 }); }); </script> This worked for me

How to correctly load this jquery script through the file functions.php?

You don’t need to include jquery-ui and jquery-ui.min either of them is sufficient . Also jquery and jquery-ui are already included in WordPress. Try this wp_enqueue_script( ‘jquery’); wp_enqueue_script( ‘jquery-ui-core’); wp_enqueue_script( ‘qs.slider’, get_template_directory_uri() . ‘/layout/assets/js/qs.slider.js’, array(‘jquery’,’jquery-ui-core’), ”, true ); wp_enqueue_script( ‘qs.slider.init’, get_template_directory_uri() . ‘/layout/assets/js/qs.slider.init.js’, array(‘jquery’,’jquery-ui-core’), ”, true ); The above code will make sure jquery and …

Read more

How can I add a new lib path without call each one on the header?

function my_custom_enqueue_scripts() { if ($handle = opendir(get_template_directory() . ‘/custom-stylesheets’)) { $i = 1; while (false !== ($file = readdir($handle))) { if ($file != “.” && $file != “..”) { wp_register_style(‘custom_stylesheets_’ . $i, get_template_directory_uri() . ‘/custom-stylesheets/’ . $file); $i++; } } closedir($handle); } } add_action(‘wp_enqueue_scripts’, ‘my_custom_enqueue_scripts’); Add code to a file: functions.php Styles should be located: …

Read more

The dropdown list in autocomplete is not showing

I have tested on my localhost. It’s working fine 🙂 You can check it. Screenshot: http://nimb.ws/Vl1L0F Default, WP has available support Autocomplete jQuery in Core. You can check it here. (find keyword ‘jQuery UI Autocomplete’). You can try to follow my code and then test again 🙂 Add code to functions.php. add_action( ‘wp_enqueue_scripts’, ‘add_scripts’ ); …

Read more