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

How to access this jQuery/AJAX data in a PHP file/WordPress plugin

WordPress provides a way to access PHP variable into .js file using the wp_localize_script so if your follow that it’s standard practice (standard practices are always advisable). Your next question is my-ajax.php and plugin URL. All ajax in WordPress process through admin-ajax.php (Standard one) that file could be found in wp-admin so wp_localize_script should be … Read more

The script works only once by clicking on the opening and closing

In general, here is my solution code: <script type=”text/javascript”> // Выполнить асинхронный Ajax-запрос с помощью метода POST. // Отправить данные на сервер и в случае успеха вывести // ответ сервера в диалоговом окне. //jQuery(document).die(‘click’, ‘#order_’+button.id) ; function showPopup (button) { jQuery(document).on(‘click’, ‘#’+button.id, function(event) { jQuery.ajax({ url: ‘/wp-admin/admin-ajax.php’, // сделали запрос type: “POST”, // указали метод … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)