put this code at the end of functions.php
add_action('customize_register', 'customizer');
function defer_parsing_of_js ( $url ) {
if ( FALSE === strpos( $url, '.js' ) ) return $url;
if ( strpos( $url, 'jquery.js' ) ) return $url;
return "$url' defer ";
}
add_filter( 'clean_url', 'defer_parsing_of_js', 11, 1 );
Related Posts:
- What can cause JavaScript and CSS files to be minified?
- Could the WP script/style loader be used to concatenate and gzip scripts and styles in the front-end?
- wp_enqueue_scripts, wp_register_scripts, wp_print_scripts: i’m confused
- How to combine multiple CSS files and concatenate JavaScripts if WordPress recommends enqueuing them?
- WordPress Displaying Thumbnails Vertically
- Changing Font-Size based on specific Font thru javascript
- Collapsible button inside a ul list does work in jsfiddle but not in WP
- Relative path instead of absolute for wp_enqueue_script
- Handling URLs in WordPress application
- Can “ and “ tags be used in the HTML editor?
- JavaScript added as link/stylesheet
- Write text below a specific part of a sentence
- WordPress on localhost working, when sharing IP to connect receive err_connection_refused on .js and .css files
- Show enqueued CSS and Script in custom header
- How to insert html/css/javascript code to wordpress plugin
- Using uncss or similar with WordPress?
- How can I use PurifyCSS to clean WordPress style.css?
- Eliminate render-blocking JavaScript and CSS in above-the-fold content
- Older isotope portfolio rows shifting downward by 1 pixel on hover
- How to integrate my HTML and javascript into my child theme
- Shrink Header Image on Scroll
- How to create fa-bars animated menu
- Does costum code in the root folder get lost when wordpress is updated?
- CSS Minification
- WordPress problematic caching
- Why is this jquery / java script code not working in mobile / in devices?
- Seperate functions.php for part of site
- How can I get the search form to be selected automatically?
- Implementing a simple slider in code?
- Cannot set property ‘className’ of null at setThemeFromCookie
- How to change “““ to “““?
- Conditionally enqueue a stylesheet based off of a javascript click event
- get_template_directory_uri() generates wrong path
- Remove CSS & JS from
- enqueing Javascript and CSS
- How to Add a Read-only Textbox With Text in it That Has a Button to Copy it?
- ACF Pro with SlickJS [closed]
- Show/Hide Div for Login Mask
- prevent HTML output if custom field is empty [closed]
- Plugins not showing up for custom template
- Equal height sections in custom Headway Theme
- How do I minify ‘@import’ css files with wp-minify?
- W3TotalCache and Javascript — what should go where, when?
- How would I create the same popup in css and javascript as the one in contact button on the site https://www.sublimotionibiza.com/es/main.html [closed]
- Combine CSS Files without plugin
- Button doesn’t work in the profile panel
- WordPress Rest Api access the header and extract stylesheets URL
- Invert porfolio item order
- How to make a function to play only on the home page?
- Embed widget from external source (Zendesk)
- Hide Tab Titles from Tabs Block
- How can I hide this custom slider while Elementor editing window is open?
- broken internal JavaScript and CSS files
- Getting and setting CSS variables with JQuery in WordPress backend fails
- Unable to use Datepicker in a table when inserting a row
- How to properly hide the div of an inline collapsible button?
- Change the version of default style.css in wordpress
- Web Developer Console: “Slow network is detected.” with fonts
- Enqueue CSS and Script only if needeed
- How to display javascript banner in website header?
- How would I add this code to a single WordPress page?
- The placeholder text doesnt disappear
- Trouble with adding preloader to my home page index.html and index.js
- Import HTML code that loads css and javascript into specific page
- How to implement a JavaScript and CSS file for my WordPress homepage?
- Bootstrap 4 Optimization
- Move main menu to top of screen
- How to remove audio player styles added by mediaelement.js JavaScript?
- Interactive maps in wordpress
- Can I upload my HTML/CSS/Javascript game onto a WordPress page?
- How do I add JS and CSS to WP (Flatsome)
- “Plate” theme broken after update
- Is there a CSS parent selector?
- How do I hide the bullets on my list for the sidebar?
- How to change the background colour’s opacity in CSS
- difference between css height : 100% vs height : auto
- How do I register/enqueue a custom CSS file?
- PageLines theme: how to change the background color of the main content vs. entire page?
- WordPress CSS head info – contents, expansions?
- Is it possible to change the path of a css file that is registered through wp_enqueue_style()?
- Adding HTML to the Header, Screws up in IE7
- Efficient way to edit WordPress themes
- Where Do I Find The Astra Default Font Family That All Text Elements Are Inheriting From? [closed]
- Incorrect MIME type for assets with Valet
- Responsive Images Warping
- Remove margin from CSS gradient color code
- How do I apply/target CSS to a specific user role or roles?
- How can I remove the ::after CSS selector which is automaticaly appended to the_content()?
- Using PHP Increment and Conditional Statement to Alternate Loop Background
- Namespacing theme CSS
- How to change the standard navigation menu color when using genesis [closed]
- Add classes + taxonomy terms to wp_list_pages() output
- WordPress footer always at the bottom of the screen-page
- Why can’t blocks be hidden with jQuery?
- CSS: Appearance/Customise display different to actual display
- How to create a mobile menu full screen overlay using Understraps Bootstrap 4 theme
- I would like to achieve a two column checkout page
- How to change menu hover color to white on my theme? [closed]
- Inserting a DIV Block Into a Listing of Excerpts?
- Do you use css reset in your child theme [closed]