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



(string) Default Tiled Gallery content width.


Since: Jetpack 2.1.0


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' );

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 )

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


  1. אודי בורג says:


    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?

  4. patbell101 says:

    Instead of a fixed width is it possible for it to fit its container?

  5. Ionut Paraschiv says:

    Hello, I’m looking to inject an additional title just before the tiled gallery output. A hijack the [gallery] shortcode affects the tiled display. Can you suggest me how to deal with it? Thank you.