I am making a dialog box using jquery ui dialog
in wordpress. The problem that I am having is when the dialog box appear, the close button 'X'
is not shown. example as below.
I have make some reading regarding this issue and it is due to conflict on bootstrap
. Reference on Stackoverflow. How do I want to implement it on wordpress? Below are my codes on functions.php
that I made
function add_my_script() {
if(is_page('my_custom_page')){
//Tried to deregister bootsrap and it work fine but I need the boostrap as well.
//wp_deregister_script('zerif_bootstrap_script');
//Tried to degregister and enqueue back the script to follow the rules base on reference
//wp_enqueue_script('zerif_bootstrap_script', get_template_directory_uri() . '/js/bootstrap.min.js', array(), '20120206', true);
wp_enqueue_script('jquery-ui-dialog');
}
}
add_action('wp_enqueue_scripts', 'add_my_script');
Update Solutions:
Currently I am using Zerif Lite on my theme and it is on function.php
.
wp_enqueue_script('zerif_bootstrap_script', get_template_directory_uri() . '/js/bootstrap.min.js', array(), '20120206', false);
The default value is true
that will be place in footer. I change the value to false so that it will be place in the header as same as my jquery-ui scripts.