Home › Forums › Jevelin Theme › 3WC Warning in
Home › Forums › Jevelin Theme › 3WC Warning in
Running the W3C validator for https://cbdfactum.com generates +50 warnings like this:
The
type
attribute for thestyle
element is not needed and should be omitted.
or
The
type
attribute is unnecessary for JavaScript resources.
<b><script type="text/javascript" data-cfasync="false"></b>
or
<b><script data-cfasync="false" data-pagespeed-no-defer type="text/javascript"></b>
See also the attached result of the validation.
I get rid of the warnings using this hook- so you won’t see currently it on the site.
add_action( 'template_redirect', function(){ ob_start( function( $buffer ){ $buffer = str_replace( [ 'type="text/javascript"', "type='text/javascript'", "type='text/css'", 'type="text/css"' ], '', $buffer ); return $buffer; }); });
I think, in one of the next updates the code could be modified so this hook is not needed and the theme generates out of the box a code without W3C warnings.
What do you think?
Thx
Hi @CBDFactum,
I hope you are well today and thank you for your question.
We will check how the default WordPress themes handle this situation and then will consider to change it if it doesn’t have any side effects.
Also, we can only change it for the scripts generated by the theme and not the plugins.
Best regards,
Shufflehound team