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 response to “Add HTML 5 Theme Support for the WordPess Native Gallery”

  1. Thanks Brad,

    Works a treat.

    🙂

Was This Tutorial Helpful?

Free

$0

Access only to all free tutorials per month.



Monthly

$75

Access to 10 premium tutorials per month.


Tutorial Request


Includes code guarantee and coding support.

Yearly

$500

Access to 15 premium tutorials per month.


Monthly Tutorial Request


Includes code guarantee and priority coding support.