lowercase_p_dangit();

apply_filters ( 'tiled_gallery_content_width', string $tiled_gallery_content_width )

Filter overwriting the default content width.

Source file: modules/tiled-gallery/tiled-gallery.php

View in GitHub

Parameters

$tiled_gallery_content_width

(string) Default Tiled Gallery content width.


Changelog

Since: Jetpack 2.1.0


Notes

You can use this filter to define a custom Content Width value, that will only apply to Jetpack Tiled Galleries:

function jeherve_custom_tiled_gallery_width() {
    return '800';
}
add_filter( 'tiled_gallery_content_width', 'jeherve_custom_tiled_gallery_width' );

Comments

  1. Hi,

    Where exactly should I place this code?

  2. gfrish says:

    Please, tell me, how can I remove padding between pictures in tiled gallery?

    • Adam says:

      You can use some CSS like this to set the padding to zero:

      .tiled-gallery .tiled-gallery-item {
      box-sizing: border-box;
      padding: 0;
      }

      Having said that, tiled galleries adjust the image size dynamically in a very complex process, so removing the padding might make some of the images look or act strangely. Getting it to work perfectly may not be possible.

  3. Quyen says:

    Hi there

    I also like to change the width of Jetpack gallery and tried adding this to code snippet but it didn’t work:

    function jeherve_custom_tiled_gallery_width() {
    return ‘800’;
    }
    add_filter( ’tiled_gallery_content_width’, ‘jeherve_custom_tiled_gallery_width’ );

    Has there been an update to the code?

Have a note to contribute?

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s