In wordpress image gallery, it uses the full image size by default for every gallery but you can select or set the another image size. Using following code you can set the default image size for your wordpress image gallery.
Select default image size for gallery in wordpress
just copy and paste following code to your functions.php file:
<!--?<span class="hiddenSpellError" pre="" data-mce-bogus="1"-->php remove_shortcode('gallery'); add_shortcode('gallery', 'custom_size_gallery'); function custom_size_gallery($attr) { $attr['size'] = 'medium'; return gallery_shortcode($attr); } ?>
Hi Purab,
Thank you for sharing this helpful code snippet. I’ve been wanting to be able to set my own size for the WordPress Gallery images for a while and your Block of code has been very helpful to me.
I was wondering if you could write another post (or update this one) on how to use this block of code on a WordPress driven website, written in way that individuals without a lot of Techie type knowledge.
Thanks heaps for this code snippet though. I’m going to work out how to implement this.
Warmly,
Ivan Bayross
Thanks Ivan