Using jquery with wordpress using wp_enqueue_scripts

It sounds like your template is missing a call to wp_head() which will output your enqueued scripts and styles. You’d normally place wp_head() in your header.php template and include this in your page template. To conditionally enqueue jQuery based on the page template being used you could use the following code: add_action( ‘wp_enqueue_scripts’, ‘custom_theme_load_scripts’ ); … Read more

WordPress 5.1 upgrade has lost the parent theme JavaScript

I traced this back to the name of the scripts.js JavaScript file. My parent theme (BeTheme) enqueues the main scripts.js like this: wp_enqueue_script(‘mfn-scripts’, get_theme_file_uri(‘/js/scripts.js’), array(‘jquery’), MFN_THEME_VERSION, true); In my child theme crmpiccodotcom/footer.php I enqueue the scripts.js like this: // include the crmpiccodotcom child theme JavaScript add_action(‘wp_enqueue_scripts’, ‘crmpiccodotcom_enqueue_scripts’); function crmpiccodotcom_enqueue_scripts() { wp_enqueue_script( ‘custom-script’, CHILD_THEME_URI. ‘/js/scripts.js’, array(‘jquery’) … Read more

Disable Cloudflare Rocket Loader for jQuery javascript and make it load first

jQuery is loaded by WordPress with wp_enqueue_script. The problem is WordPress also use the below code to change the handle public function localize( $handle, $object_name, $l10n ) { if ( ‘jquery’ === $handle ) { $handle=”jquery-core”; } The solution is to use the function function wpse_script_loader_tag( $tag, $handle ) { if ( ‘jquery-core’ !== $handle … Read more

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