Change Thumbnail Image Gallery Size In WordPress

WordPress, as CMS, let’s you create gallery in it. It also allows you to choose the sizes to display the gallery image sizes within it. But, what if you do not want to use the Thumbnail size provided via WordPress at all. Is it doable? Well it is doable. And here we will describe about how to change thumbnail image gallery size in WordPress to other default size.

How To Create Gallery In WordPress?

First of all, in order to change thumbnail image gallery size in WordPress, you might need to know about how to create gallery in WordPress. So, lets move ahead and lean about how to create gallery in WordPress, shall we?

So, for this, first of all, open up the required post/page to add gallery in your site. Now after that, click on the Add Media button in the post editor section, which will open up modal for image addition in posts/pages created for your site.

After that, you need to click on the Create Gallery button on from the left top corner from the image popup modal box. Now, you need to either upload new images or use the existing ones as required. After the image selection is completed, you need to click on the Create a new gallery button and now the gallery is created.

Here, in the above screenshot, you can see that we have pointed out the first step in creating WordPress gallery images. Now, after clicking on the button mentioned, you will now need to choose the size of the gallery as needed, order the gallery images and others and then after those are completed, click on the Insert gallery button and gallery is now successfully created.

Now, since you now know about how to create gallery in WordPress, now let’s move ahead and lean about how to change thumbnail image gallery size in WordPress, shall we?

How To Change Thumbnail Image Gallery Size In WordPress?

Since you have now learned about how to create gallery in WordPress, now we will be learning about to change thumbnail image gallery size in WordPress. So, for it, first of all, you need to know on which hook you need to hook up this custom code. Well, the hook for this is: shortcode_atts_gallery and here, we will learn on this.

For this code to be added to filter the image size, you need to edit the functions.php file of the child theme or main theme file. So, lets move ahead and paste the below PHP code in the functions.php file as required:

In the above PHP code, you can see that we have added 'size' => 'creative-blog-featured-thumb', where the size resides. You need to modify that as required for your theme and the default thumbnail image gallery size will be changed onto that size.

Output Of How To Change Thumbnail Image Gallery Size In WordPress

Now, after doing the mentioned work on the functions.php of the theme, you can see the similar result as below for your site too:

Here, in the above screenshot, you can see that now the default gallery thumbnail size is changed to our custom image size. Also, if you have successfully applied the same for your site too then, you can see out the similar result as above.

You may also want to read:

  1. Integrate Bootstrap NavBar 4 Into WordPress Theme
  2. Apply Custom CSS Code In Your Site Via Inspect Element
  3. XML Sitemap Support For Custom Post Type Using JetPack
  4. Make YouTube And Vimeo Video Responsive In WordPress
  5. Tutorial On Creating WordPress Child Theme

Conclusion

If you have followed up the tutorial properly and now can change thumbnail image gallery size in WordPress with ease then, we can say that you are now more familiar on this than before. However, if you are still confused on the same and want to know more about it then, do drop the comment below in the comment box and we will follow it up.

, , , , , , , , , , , , , , , , , ,

Post navigation

Bishal Napit

Bishal Napit is a WordPress theme developer from Tansen, Palpa, with a passion to learn more on WordPress.

2 thoughts on “Change Thumbnail Image Gallery Size In WordPress

  1. I came to your website to ask a question. Not sure if this post answers it. My main page is kind of scattered looking. I thought if I changed all my pictures in my media file to the same height, the posts would line up, but that didn’t work.
    I want everything to look like a grid.
    It’s still a work in progress, as I started on this last fall, stopped and now am active again.
    Maybe I just need to have my landing page be my most recent post.
    The looks of the landing page just bothers me.

    1. For the image height, you need to edit the posts or page created for same and then change the width and height value for that image from there, editing the image itself there, not from within the Media Library from within WordPress.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.