Add HTML5 Support to your WordPress Theme Using Jetpack

A lot of WordPress themes are now built entirely with HTML5. I think Rootdip (previously HTML5Press), was one of the first WordPress themes to utilize many HTML5 elements. Some themes, however, don’t make use of HTML5 at all. WordPress has the ability to allow the use of HTML5 markup for comment forms, comment lists, and search forms.

Your theme has to use add_theme_support( 'html5' ). Much of this was inspired by this post from Konstantin Obenland on ThemeShaper, as was the featured image for this post, heh.

Active Theme Support

This is really easy. All you need to do is call add_theme_support( 'html5' ), essentially. More specifically, in the functions.php file for your theme, add the following.

function prefix_setup() {
    add_theme_support( 'html5', array( 'comment-list', 'search-form', 'comment-form', ) );
}
add_action( 'after_setup_theme', 'prefix_setup' );

That’s all there is. Your comment lists, comment forms, and search forms will now be marked up with HTML5!

Comment lists, comment forms, and search forms are the only html5 arguments supported currently, it’s possible many different arguments will be added at a later date. It may not be required though.

If you do build support for this into your theme, it’d probably be a good idea to add it in as an option that users can enable or disable at their discretion.

0

Well, now what?

Work with Me

I'm available for hire and always taking new clients, big and small. Got a project or an idea you'd like to discuss? Startup plan but no developer to make it happen? Just get in touch, I'd love to see if I can help you out!

Leave some Feedback

Got a question or some updated information releavant to this post? Please, leave a comment! The comments are a great way to get help, I read them all and reply to nearly every comment. Let's talk. 😀

Longren.io is proudly hosted by DigitalOcean

DigitalOcean

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.