Setting JetPack’s Tiled Mosaic Gallery to Full Width

Today we are going to cover how to modify your WordPress theme for Setting JetPack’s Tiled Mosaic Gallery to Full Width.

WordPress’s JetPack plugin comes with dozens of easy to implement features, one of which being the popular tiled mosaic gallery, but the biggest problem people run into is how to setup the mosaic gallery to run in full width. Normally, the mosaic will not display in full-width because your theme does not have the global content_width variable set. Otherwise, the theme developer set the width too small which stops the mosaic gallery from display in full width. Whichever the case is for you, modifying your theme with a few lines of code will easily fix the issue.

Before adding the necessary code, you first need to know what the width of your content area is. This can easily be done (in FireFox or Google Chrome) by right clicking on the page, and selecting the inspect element option. inspect-element

From there, find the content div wrapper and check what the width is. In most cases, that is the number you will use to define the <em>content width</em> variable later.content-div

 

Once you have found the width of your page, simply open the functions.php file in your themes root directory, and add (or modify) the following block of code:

 

if ( ! isset( $content_width ) ) {
	$content_width = 960;
}

Save the functions.php file, and you should be all set and have beautiful tiled mosaic galleries that fill out your page like the one below.

full-width-mosaic-gallery

Leave a Comment

Your email address will not be published. Required fields are marked *