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


  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: 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 )

Google+ photo

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

Connecting to %s