apply_filters ( 'gallery_widget_content_width', int self::DEFAULT_WIDTH, string $args, array $instance )

Allow the width of a gallery to be altered by themes or other code.

Source file: modules/widgets/gallery.php

View in GitHub



(int) self::DEFAULT_WIDTH Default gallery width. Default is 265.


(string) Display arguments including before_title, after_title, before_widget, and after_widget.


(array) The settings for the particular instance of the widget.


Since: Jetpack 2.5.0


You can use this filter to change the width of the Gallery Widget, like so:

function jetpackcom_custom_gallery_content_width(){
	return 400;
add_filter( 'gallery_widget_content_width', 'jetpackcom_custom_gallery_content_width' );

Have a note to contribute?

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s