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.


Comments

One response to “Add HTML 5 Theme Support for the WordPess Native Gallery”

  1. Thanks Brad,

    Works a treat.

    🙂

Leave a Reply

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.