• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2665

Original Genesis Tutorials & 5000+ Guaranteed Code

Snippets

  • Support
  • Newsletter
  • Videos
  • Log in

Premium Member? - Request custom code

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.

Reader Interactions

Comments

  1. LianaG says

    September 27, 2016 at 3:55 pm

    Thanks Brad,

    Works a treat.

    🙂

    Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

PHP Code

template_include

get_body_class

if else

array

class_exists

foreach

sprintf

add_action

printf

variable

Advertise · WPEngine · Genesis · Log in

  • How Premium Membership Works
  • Sign Up
  • Support
  • Subscription Details/Invoice
  • Tagged Tutorials
  • Access-Download Problems