WordPress 5.3 introduces a considerably simpler way to achieve this. By registering theme support for HTML 5 for script
and style
, the type=""
attribute will be omitted:
add_action(
'after_setup_theme',
function() {
add_theme_support( 'html5', [ 'script', 'style' ] );
}
);
Related Posts:
- wp_enqueue_script was called incorrectly
- How to display error messages using WP_Error class?
- Remove Menu Page Giving Error
- Restrict user registration to emails on a single domain
- Functions.php reverted to new one
- How to load some jquery code to make validation in the theme customizer?
- Why is my Gutenberg block returning an error after initial save?
- How do I edit wp_head and/or functions.php to remove rss-feed which isnt used and dont validate?
- Debugging with functions.php
- How to force field validation first, then its values saved durning edit profile?
- Warning: : DOMDocument::loadHTML(): Empty string supplied as input in functions.php when adding classes to post images
- Parse error after modifying the template menu [closed]
- help I changed one currency in woocommerce and everything is ruined [closed]
- Need help getting a function to function
- Connecting to a 2nd DB gives me no results when querying
- debugging errors.. how to remedy?
- Functions Error: Impacting Galleries
- contact form in template with jquery,validate and ajax
- Strange error from functions.php files (wp_register_script)
- Show errormessages on wrong username/password on custom loginform?
- Problems with functions.php! Error! [closed]
- Looking for Functions File that doesn’t Exist
- functions.php pharse error on complete new install
- “Conditional query tags do not work before the query is run. Before > then, they always return false. “
- MCAPI.class.php showing some error
- I’m getting invalid taxonomy in init action
- Restrict certain roles registrations by domain
- Translation Function missing text-domain [closed]
- What is wrong with functions.php? Fills error log with same error
- Random text changing to weird icons in both admin & front end
- jQuery HoverIntent is not a function
- create submenu page – error function not found or invalid function name
- Why does modifying my functions.php file always result in a server error
- Notice: Use of undefined constant REQUEST_URI – assumed ‘REQUEST_URI’ in ….functions.php on line 73
- WP Debug enabled Undefined index error in a widget
- Woocommerce – Checkout error message
- How to fix enqueue_styles error for a twenty-seventeen childtheme
- Comment turned Invisible
- Logout redirect via page template without confirmation?
- Convert Image to Webp on upload without plugin
- Why isn’t is_page working when I put it in the functions.php file?
- Add image size if page template
- How to load parent_theme functions.php before child_theme?
- Removing default image size list in Media Box
- How to create thumbnails for PDF uploads?
- How to override function in functions.php of parent theme?
- Override a plugin class function
- Copy and delete a directory with WordPress functions
- Creating a table from shortcode avoiding wpautop for each row
- Including a function into a theme
- Redeclare function (override) [closed]
- wp_register_script not loading as expected
- WP_Cron doesn’t do the job: Multisite stats
- Simple/basic use of get_current_screen
- How to display most viewed post in my sidebar?
- override parent theme configuration in child functions.php
- Why won’t my scripts load?
- Overwriting Parent Theme’s Image Sizes
- Hard-coding custom menu elements for menu manager
- Do not add content filter on page template
- Create post using Ajax
- Function to update post_meta based on existing post_meta
- Load jquery only for certain pages in the backend
- Custom styles.css sheet for visual editor
- Publishing just a Facebook URL without full code snippet
- Filter an WordPress Function in (general-template.php)
- Show some menu sub items as dropdown under a menu item
- Set “woocommerce_is_purchasable” to false for specific “$product->is_stock_status”
- The correct way to add a JavaScript in the functions.php [closed]
- How to remove some item from WordPress Dashboard for user Author
- Disabling Author Page only for subscribers
- Showing user profile data on front-end
- How to register a menu based on a ACF condition
- How to convert raw url to hyperlink?
- Breaking up multiple words and inserting an image after first word
- get content from page through AJAX
- colorbox not loading in
- how can I change all wordpress media file url to custom cdn url?
- Changing the HTML of notices in WooCommerce [closed]
- Save_post – Warning: Cannot modify header information
- How to use WP conditional tag in a functions.php with OCEANWP Theme?
- Modify content inside post before first publish
- Pass an argument into a function to extract from array
- function class doesnt work
- how to remove a tag in the_category function
- Load CSS file conditionally
- my wordpress doesn’t save items to customized widget area
- Copying a widget class to functions.php results on a blank page
- No compression occurs on my jpegs after adding jpeg_quality hook to my functions.php file
- Changing the register url is not working
- Newest comments first not working
- Pass arguments to function class with do_action()
- How to a override parent theme page that has been included with require_once?
- Can I use a function to return HTML and the result of another function?
- Excerpt length: get 2 paragraphs
- Remove heading tags on line break
- Sort results by name & asc order on homepage
- I want to add the alt attribute to all the photos!
- Creating mixture of shortcodes to use in the visual/text editor
- Is storing in a variable the result of a fonction a most powerful way to code an if structures in WordPress?