was successfully added to your cart.

How to change the default settings of WordPress Gallery

By August 28, 2015 Our Blog No Comments

I will show how to change the default settings of the WP Gallery. I mean, the number of columns, size and the link. WordPress Galleries usually default to using the thumbnail size of 150 x 150 (px) and 3 columns across.

1) Open up the functions.php file in  in the wp-content/themes/your-theme-directory

2) Copy and paste the code below to your theme functions.php

[code] //Galerie Setting
function my_gallery_default_type_set_link( $settings ) {
$settings['galleryDefaults']['link'] = 'file';
$settings['galleryDefaults']['size'] = 'medium';
$settings['galleryDefaults']['columns'] = '2';
return $settings;
}
add_filter( 'media_view_settings', 'my_gallery_default_type_set_link');
[/code]

This function changes the default attributes for the gallery to be columns=”2″ and size=”medium”.

Leave a Reply

Click to Get Full Access to our entire collection for only $69! Get Access Today