November 15, 2018 at 5:51 pm #224380
When trying to validate a Genesis Child Theme (the Genesis Sample child), the W3C Validator gives this error:
There's plenty of help/snippets out there for removing the TYPE attribute from enqueued files. But they don't work on the Genesis Responsive Menu js that gets inserted in the footer.
Thanks.November 15, 2018 at 7:21 pm #224384
While the script is being loaded by the Genesis Sample theme in functions.php, Genesis is simply executing the WordPress wp_enqueue_script to do so. The type attribute is inserted by WordPress, not Genesis. You're best bet for finding a solutions is to Google and look at the many recommendations out there.
November 15, 2018 at 7:51 pm #224385November 20, 2018 at 3:18 am #224467
Thank you for responding.
I apologize for not replying back sooner.
I think the forum notification went to spam.
Either way - I'll check out the code you found and reply again.
Thanks!November 22, 2018 at 3:11 am #224517
I checked out the code you'd found online.
I actually already have that code in my theme - and it works great for enqueued js and css.
However, that code does not remove the TYPE attribute from the Genesis Responsive Menu setup script. That script is used/called (my js ignorance is showing) using wp_localize_script (not enqueue). So my hunch is that has something to do with it.
I need to move on to other issues for now.
But I'm determined to validate this Genesis theme.
So if I get a solution - I'll share here.
And hopefully, if someone else does, they will too.
All the best,November 24, 2018 at 11:46 am #224571
The code I provided for you works for me with the responsive script. I tested it with multiple themes in my local environment and edited it for performance. Code used with wp_localize_script still requires a script to be enqueued. All wp_localize_script does is setup a script for translation. It has nothing to do with enqueuing.
Also if you look at the sample theme's functions.php. You'll see the responsive script is being enqueued right before wp_localize_script is called.
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.