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

On click load iframe [closed]

Did you inspect your code for any errors? If the error is “Uncaught TypeError: $ is not a function”, then maybe you can add the code as below. <script> jQuery(document).ready(function($) { //your code starts here <iframe id=”myiFrame” class=”stop-lazy” data-src=”https://some.iframe” frameborder=”0″ allowtransparency=”true” style=”width: 100%;min-height: 150px;”></iframe> }); </script>

Can inactive WordPress plugins still load scripts?

Many hypotheses could be made, but the most probable ones are that the theme or a third plugin loads the script if a specific option saved in the database has a certain value. If the plugin is installed but not active that hypothetical option still exists in the database, on the contrary, when you delete … Read more

Minimizing scripts & css files that plugins add

I would suggest using a minify plugin that will automatically combine all the scripts and styles for you. Here are a few that will do it for you: http://wordpress.org/extend/plugins/w3-total-cache/ http://wordpress.org/extend/plugins/bwp-minify/ http://wordpress.org/extend/plugins/wp-minify/ http://wordpress.org/extend/plugins/minify/