Problem:
- W3 Validator says:
Warning: The type attribute is unnecessary for JavaScript resources.
Solution:
- In
functions.php
insert following code:
<?php
function removeTypeJS($x) {
ob_start();
call_user_func($x);
echo preg_replace("/type=['\"]text\/(javascript|css)['\"]/", '',ob_get_clean());
}
?>
- Replace
<?php wp_head(); ?>
in template with:<?php removeTypeJS("wp_head"); ?>
- Replace
<?php wp_footer(); ?>
in template with:<?php removeTypeJS("wp_footer"); ?>
Top comments (0)