Move scripts to footer, but exclude one script?

To stop enqueueing a script We’re dequeueing the scripts completely (regardless from header or footer) with a higher priority (10+): function dequeue_my_scripts() { wp_dequeue_script(‘script-handle-here’); } add_action( ‘wp_print_scripts’, ‘dequeue_my_scripts’, 11 ); To put the script to footer function enqueue_scripts_to_footer() { wp_enqueue_script(‘script-handle-here’); } add_action( ‘wp_footer’, ‘enqueue_scripts_to_footer’ ); Right way doing this But the right way enqueueing the … Read more

wp localizing script not works

There are a few things wrong…the most pertinent of which is that the script that you’re going to localize with wp_localize_script() must be registered before you call wp_localize_script(). Secondly, your call to wp_enqueue_script( ‘reservation-scripts’ ) doesn’t provide the source (i.e., URL) for the script. Lastly, they way you are enqueueing jQuery is incorrect. So, if … Read more

Exclude external uri for css and js version

Declaring functions inside functions can lead to problems as explained here: https://stackoverflow.com/a/1631579/1228379 To solve the issue of remote files, you can use an additional parameter to indicate it is remote (or local) and call get_theme_file_uri/path accordingly. Alternatively, you can just call wp_enqueue_script/style directly and use standard version numbers, or simply save the files locally. In … Read more

Including files in Child Themes

get_template_directory looks in the parent theme for files. In the case a child theme is being used, the absolute path to the parent theme directory will be returned. Use get_stylesheet_directory() to get the absolute path to the child theme directory. http://codex.wordpress.org/Function_Reference/get_template_directory This file is not meant to be replaced. You will need to find another … Read more

jquery-ui-autocomplete is not loaded with wp_enqueue_script

Are you sure it is not loading? I tried this(using WordPress 3.6-beta1): function add_scripts(){ wp_enqueue_script( ‘jquery-ui-autocomplete’ ); } add_action(‘wp_enqueue_scripts’, ‘add_scripts’); I got jQuery and jQuery migrate in the header: <script type=”text/javascript” src=”http://localhost/wordpress/wp-includes/js/jquery/jquery.js?ver=1.9.1″></script> <script type=”text/javascript” src=”http://localhost/wordpress/wp-includes/js/jquery/jquery-migrate.js?ver=1.1.1″></script> And jQuery UI in the footer: <script type=”text/javascript” src=”http://localhost/wordpress/wp-includes/js/jquery/ui/jquery.ui.core.min.js?ver=1.10.2″></script> <script type=”text/javascript” src=”http://localhost/wordpress/wp-includes/js/jquery/ui/jquery.ui.widget.min.js?ver=1.10.2″></script> <script type=”text/javascript” src=”http://localhost/wordpress/wp-includes/js/jquery/ui/jquery.ui.position.min.js?ver=1.10.2″></script> <script type=”text/javascript” src=”http://localhost/wordpress/wp-includes/js/jquery/ui/jquery.ui.menu.min.js?ver=1.10.2″></script> <script type=”text/javascript” … Read more

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