I’m using the jquery ui framework to add some slider and accordion to my options, but after I enqueue the jquery ui framework the draggable boxes of the post and pages stop to work… they don’t even close/open anymore.
Anyone have any tip?
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Author has had an Item Featured
- Author had a Free File of the Month
- Author was Featured
- Bought between 10 and 49 items
- Exclusive Author
- Has been a member for 4-5 years
- Referred between 100 and 199 users
wrong order of files? noconflict?
you may want to see what script are added two times and stop adding them, or just deregister as i do above. for the jquery ui, the deregisters are$dir = get_bloginfo('template_directory'); wp_deregister_script("jquery"); wp_enqueue_script("jquery", $dir."/js/jquery.js", false, null);
- jQuery UI Core – jquery-ui-core
- jQuery UI Tabs – jquery-ui-tabs
- jQuery UI Sortable – jquery-ui-sortable
- jQuery UI Draggable – jquery-ui-draggable
- jQuery UI Droppable – jquery-ui-droppable
- jQuery UI Selectable – jquery-ui-selectable
- jQuery UI Resizable – jquery-ui-resizable
- jQuery UI Dialog – jquery-ui-dialog
you could try to move the new scripts to the wp_footer, to do that you just need to add a true value. i will explain with the example above
thanks… I’ll make some tries… I’ll let you know
you are welcome.
Are the UI JS files loading properly in the document? It has happened to me. When we use wp_enqueue_script(), it loads jquery just fine. But when we try to (especially) load ui-core, ui-tabs and ui-accordion, it just don’t.
So I had to load them in dependency order. i.e.
wp_enqueue_script('custom', get_bloginfo('template_directory') . '/js/custom.js', array('jquery-ui-core', 'jquery-ui-tabs'), '1.0' );
this solved the issue:
wp_register_script('pk_jquery_ui', PK_THEME_DIR.'/parkerandkent/js/admin/jquery_ui/jquery-ui-1.8.6.custom.min.js', array('jquery'), null, true); wp_enqueue_script('pk_jquery_ui');
The in footer param needed to be set to true.
Thanks to all of you for the tips
told you about the footer param glad you solved it.