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
Gonzo Magazine Wordpress Theme Demo
Gonzo Magazine Wordpress Theme Demo
Zeno Amazon Affiliate WordPress Theme Review| Build Your
Zeno Amazon Affiliate WordPress Theme Review| Build Your ...
Create A Custom Front Page For The Responsive WordPress Theme
Create A Custom Front Page For The Responsive WordPress Theme
Cherish Art Cherish Art 100% Hand Painted Oil Paintings Gift Full Blossom 5-Piece Wood Inside Framed Hanging Wall Decoration
Home (Cherish Art)
  • Size:10x24Inchx3 (25x60CMx5)
  • Gallery wrapped and stretched with wooden frame on the back. Ready to hang. Edges are painted. A perfect wall decoration for living room, bedroom, office, hotel...
  • Hand-painted high quality canvas oil painting painted by professional artists with years of oil painting experiences. A great gift idea for your relatives and friends.
  • Actual painting may be slightly different from the product image due to the different brand of monitors,Please refer to the colors shown in the photo. Materials/Milieu:...
  • Why Hesitating? Just Choose to decorate your house to be much more warming during every day! Once you choose Cherish Art oil paitings, we will send you the official...
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)
  • Size: 10x16Inchx2, 8x20Inchx2, 8x24Inchx1 (25x40CMx2,20x50CMx2,20x60CMx1).
  • Subject: Yellow Lily Bottle, 5 Panels.
  • Materials/Milieu: Thick Canvas, high quality oil or Acrylic colors. The depth is 2/3Inch (1.8CM).
  • 100% hand painted. Actual painting may be slightly different from the product image.
  • Gallery wrapped and stretched with wooden frame on the back. Ready to hang. Edges are painted. A perfect wall decoration for living room and bed room.
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)
  • Size: 12x20Inchx2, 8x24Inchx2, 8x28Inchx1 (30x50CMx2, 20x60CMx2, 20x70CMx1).
  • Gallery wrapped and stretched with wooden frame on the back. Ready to hang.
  • Edges are painted. A perfect wall decoration for living room and bed room.
  • 100% hand painted. Actual painting may be slightly different from the product image.
  • Materials/Milieu: Thick Canvas, high quality oil or Acrylic colors.
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)
  • Size: 10x15Inchx1, 8x24Inchx1, 10x20Inchx1, 10x12Inchx1 (25x37.5CMx1,20x60x1CM,25x50CMx1,25x31CMx1).
  • Gallery wrapped and stretched with wooden frame on the back. Ready to hang.
  • Edges are painted. A perfect wall decoration for living room and bed room.
  • 100% hand painted. Actual painting may be slightly different from the product image.
  • Materials/Milieu: Thick Canvas, high quality oil or Acrylic colors.
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)
  • Size: 12x24Inchx2 (30CMx60CMx2).
  • Subject: Trees in two colors
  • Materials/Milieu: Thick Canvas, high quality oil or Acrylic colors. The depth is 2/3Inch (1.8CM).
  • 100% hand painted. Actual painting may be slightly different from the product image.
  • Gallery wrapped and stretched with wooden frame on the back. Ready to hang. Edges are painted. A perfect wall decoration for living room and bed room.
Related Posts