apply_filters( ‘gallery_style’, string $gallery_style )

In this article

Filters the gallery shortcode’s default CSS styles and opening HTML div container.

Description

To remove the CSS entirely, use the use_default_gallery_style filter instead:

add_filter( 'use_default_gallery_style', '__return_false' );

Parameters

$gallery_stylestring
Default CSS styles and opening HTML div container for the gallery shortcode output.

Source

$output = apply_filters( 'gallery_style', $gallery_style . $gallery_div );

Changelog

VersionDescription
7.0.0Removed the type attribute for any theme.
5.3.0Removed the type attribute for style tags when the theme supports HTML5 style, and changed the quotes from single to double for other themes.
3.1.0Added classes for number of columns and size to opening div.
2.5.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.