Overriding Gallery Margin

The simplest method is to remove the WordPress-injected inline style definitions, so that you can control style completely via the Theme:

/**
 * Remove default gallery shortcode inline styles
 */
add_filter( 'use_default_gallery_style', '__return_false' );

Note that this will remove ALL WordPress-injected gallery CSS definitions, so you may need to port some of the original style definitions into your stylesheet.

Leave a Comment