Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
I’m not sure what you mean, why would this be specific to WordPress. WordPress doesn’t limit the use of HTML.
Thread Starter
Guido
(@guido07111975)
Hi,
At first my themes did not support the article tag and because of that the comments did not list properly in older browsers.
So I added this in my functions file:
function themename_html5() {
echo '<!--[if lt IE 9]>'. "\n";
echo '<script src="' . esc_url( get_template_directory_uri() . '/js/ie.js' ) . '"></script>'. "\n";
echo '<![endif]-->'. "\n";
}
add_action( 'wp_head', 'themename_html5' );
And added this in the ie.js file:
document.createElement('article');
And now comments do list properly in older browsers.
I would like to have a list, so I don’t forget tags.
That’s what I mean.
Guido
Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
Just load in modernizr’s CSS file instead http://modernizr.com/
Thread Starter
Guido
(@guido07111975)
Edit: I guess this (function themename_html5 and file ie.js) is not necessary, when I style all those html5 tags in my css file?
Guido
Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
Oh sorry, it’s modernizr JS file you want. I’d recommend you use a third party for this. You don’t want to be updating your theme every time a new html5 tag comes out/ becomes redundant.
Thread Starter
Guido
(@guido07111975)
Maybe a stupid question, do I really need your or my script for html5 support in older browsers? Or is adding styling of these tags in my stylesheet sufficient?
Guido
Thread Starter
Guido
(@guido07111975)
Yeah, it was a stuped question: IE 8 (and older) don’t recognize html5 tags.
The problem with IE8 and lower browsers is that they were created years ago before any of the new HTML5 tags were invented so it can’t support them.
Closing this.
Guido