Try it with this plugin:
https://ww.wp.xz.cn/plugins/cleaner-gallery/
I also wrote a script for this a long time ago but it still works (WP 4.0.1):
https://github.com/keesiemeijer/gallery-shortcode-defaults
With my script you’ll need to add the defaults in your theme’s functions.php file:
add_filter( 'media_uploader_gallery_defaults', 'new_gallery_shortcode_defaults' );
function new_gallery_shortcode_defaults( $defaults ) {
$defaults = array(
'link' => 'file', // 'post', 'file', 'none'
'columns' => 4, // # number
'_orderbyRandom' => '', // 'on' or empty string ''
'size' => 'thumbnail', // 'thumbnail', 'medium', 'large', 'full'
);
return $defaults;
}
btw:
consider creating a child theme instead of editing your theme directly – if you upgrade the theme all your modifications will be lost. Or create a plugin with the code above.
Hi,
I tryed cleaner gallery with the script in my functions.php but it wont work…
Choose one or the other.
With the cleaner gallery plugin you can only link to the media file and not set the columns.
To use the code above in your functions.php you first have to download the zip file from the github page (click the Download ZIP button). Unzip it, Add it to your plugins folder and activate the Gallery Shortcode Defaults plugin (script).