Semantic HTML5 WordPress theme
WordPress 3.6 introduced HTML5 versions of popular template tags, starting out with comments, the comment form, and the search form. With the 3.9 release we add galleries and captions to that list. Now, when adding HTML5 support for those features, WordPress will use and elements, instead of the generic definition list markup.
To declare that your theme supports these new HTML5 features, add the following call to your theme’s functions.php file, preferably in a callback to the after_setup_theme action:
add_theme_support( 'html5', array( 'gallery', 'caption' ) );
For forward compatibility reasons, the second argument with the specific parts can’t be omitted when registering support. Otherwise a theme would automatically declare its support for HTML5 features that might be added in the future, possibly breaking its visually because of it.
For both galleries and captions not only the markup changes when a theme declares its support for them, there are also peripheral changes that come with it.
Galleries
By default, galleries will not include inline styles anymore when in HTML5 mode. This caters to the trend of disabling default gallery styles through the use_default_gallery_style filter, a filter that even the last two default themes used. With that, theme developers can always start with a clean slate when creating their own set of gallery styles.
We also took the opportunity to remove the line breaks between rows of images. Not only did they encourage an inferior way of positioning elements, more importantly they were non-semantic html elements that are meant for presentational use, and they made it harder to style galleries.
Captions
We were not able to completely remove the inline style in HTML5 mode, it’s still necessary to force captions to wrap, but we’re no longer the adding 10px of width. We also removed caption styles in the editor, bringing it on par with how non-captioned images are displayed:
Twenty Thirteen and Twenty Fourteen have been updated to support both features, while retaining backwards compatibility with older WordPress versions. There is a remote possibility however, that child themes that use element selectors to overwrite gallery or caption styles can lose those customizations. Please test your child themes with the current development versions of the last two default themes.
You might also like
Cherish Art 100% Hand Painted Oil Paintings Gift Full Blossom 5-Piece Wood Inside Framed Hanging Wall Decoration Home (Cherish Art)
|
Sangu Gift 100% Hand-painted Hot Selling Framed 5-Piece Yellow Lily Bottle Oil Paintings Canvas Wall Art for Home Decoration(10x16Inchx2, 8x20Inchx2, 8x24Inchx1) Home (Eve's Temptation)
|
Sangu 100% Hand Painted Wood Framed Giraffe Meeting in Middle Africa Home Decoration Paintings For Living Room Gift on Canvas 5-piece Art Wall Decor Home (Eve's Temptation)
|
|
Sangu 100% Hand Painted Wood Framed Delicate Words Abstract Paintings For Living Room Modern Oil Paintings Gift on Canvas 4-piece Art Wall Decor Home (Eve's Temptation)
|
|
Sangu 100% Hand Painted Wood Framed 2-piece Hot Sale Twilight Woods For Abstract Oil Paintings Gift Canvas Wall Art Paintings For Living Room. Home (Eve's Temptation)
|