How to properly Remove certain CSS / JS files from template

You can use this function that removes woocommerce styles/scripts if it’s your custom template, remember to change YOUR_TEMPLATE_FILE.php to match the specified template you want to remove the woocommerce css/js from it. add_action( ‘wp_enqueue_scripts’, ‘woo_cleaner’, 99 ); function woo_cleaner() { remove_action( ‘wp_head’, array( $GLOBALS[‘woocommerce’], ‘generator’ ) ); //dequeue scripts and styles if template matches if … Read more

Adjusting jquery for WordPress

By default, jQuery runs in no conflict mode in WordPress. You have an anonymous function that passes the jQuery object so you can use it. Your code will error on line two because it doesn’t know what $ is. Move the first three lines into the anonymous function to resolve this. (function($){ var array = … Read more

Why is wp_localize_script returning false?

Handle name doesn’t match registered script name in your snippet. wp_enqueue_script has ajax-script and localize has ajax_script notice the dash and underscore. You should also follow example from the docs a. register, b. localise, c. enqueue; like so: <?php // Register the script wp_register_script( ‘some_handle’, ‘path/to/myscript.js’ ); // Localize the script with new data $translation_array … Read more

Performance vs plugin genrated javascript

When enqueuing a custom script, you can write them to load in the footer – prior to the </body> tag – making them non-render blocking for most purposes, but they may still come up as render-blocking on testing tools, since they literally must be executed before the page HTML can be considered fully loaded. Instead, … Read more

Redirect to another page using contact form 7? [closed]

Redirect to another page using contact form 7? [closed]