WordPress Themes

Add HTML 5 Theme Support for the WordPess Native Gallery

WordPress now supports HTML 5 galleries.

If you want to use the native gallery shortcodes in WordPress, you’ll also need to add HTML 5 gallery support to your theme.

For Genesis users, there’s 2 steps involved:

  1. Add PHP to your child themes functions file
  2. Add CSS to your child themes style.css file

Here’s the code which adds support for a HTML 5 gallery in themes running on Genesis.

add_theme_support( 'html5', array( 'gallery' ) );

You’ll also need to add the new CSS which displays your gallery correctly:

This post is based on this question:

I recently added a native WordPress gallery to a site built with Executive Pro and Genesis. It was working fine. However now the images are stacked on top of each other vertically when viewing the page. In the editor it shows up correct.

One reply on “Add HTML 5 Theme Support for the WordPess Native Gallery”

Leave a Reply

Your email address will not be published. Required fields are marked *