Languages: English • Markup 日本語 (Add your language)
Theme Markup is a theme feature, first introduced in Version 3.6. This feature allows themes to explicitly choose to apply HTML5 markup for search forms, comment forms, comment lists, gallery and caption.
Since Version 3.6, themes should use add_theme_support() in the functions.php file in order to support theme markup, like so:
add_theme_support( 'html5', array( 'gallery' ) );
The second parameter accepts one or more values indicating which HTML5 features to support. Support for 'search-form', 'comment-form' and 'comment-list' were added in Version 3.6. Support for 'gallery' and 'caption' were added in Version 3.9.:
$args = array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', 'meta', 'style', 'script', ); add_theme_support( 'html5', $args );
The second argument is a required parameter for forward compatibility reasons. Namely, so a theme won't break in newer versions of WordPress that have HTML5 features not supported by an older theme.
<figure>
and <figcaption>
elements, instead of the generic definition list markup to output galleries. More on this in the Make WordPress Core article.Theme Support:
add_theme_support(),
remove_theme_support(),
current_theme_supports()
Theme Features:
sidebar,
menus,
post-formats,
title-tag,
custom-background,
custom-header,
custom-logo,
post-thumbnails,
automatic-feed-links,
html5,
editor-style,
content_width