Change Divi Filterable Portfolio Grid Thumbnail Sizes

Written by Dan Mossop

The Divi Theme’s filterable portfolio module gives you the option of displaying your projects as a series of thumbnails (grid view). To adjust the size and spacing of the images in your thumbnail grid, you can use the following CSS:

/* Set the image widths */
.et_pb_filterable_portfolio_grid .et_pb_portfolio_item,
.et_pb_filterable_portfolio_grid .column_width,
.et_pb_filterable_portfolio_grid .et_pb_portfolio_image,
.et_pb_filterable_portfolio_grid .et_pb_portfolio_image.portrait img
{
    width: 250px !important;
}
.et_pb_filterable_portfolio_grid .et_pb_portfolio_image img
{
    min-width: 250px;
}

/* Set the image heights */
.et_pb_filterable_portfolio_grid .et_pb_portfolio_image,
.et_pb_filterable_portfolio_grid .et_pb_portfolio_image.landscape img
{
    height: 250px !important;
}
.et_pb_filterable_portfolio_grid .et_pb_portfolio_image img
{
    min-height: 250px;
}

/* Set the spacing between images */
.et_pb_filterable_portfolio_grid .et_pb_portfolio_item { 
	margin-bottom:25px !important; 
	margin-right: 25px !important; 
}

It looks complex, but it’s very simple to change it to suit your needs. There are three parts. First we set the image width to 250px. Then we set the height to 250px (to get square images, in this case). Finally we set the space between adjacent images to be 25px.

The width normally available to the filterable portfolio images is 1080px and if the images are taking up too much space the ones on the end will be pushed down to the next row. So if you want 4 images per row, make sure that 4*width + 4*spacing <= 1080px.

Unlock the Full Potential of Shortcodes in Divi!

Empower your Divi site with the Divi Shortcode Enabler. This plugin allows shortcodes to run effortlessly in various Divi module fields, enhancing functionality and customization across your site. Perfect for achieving the precise layout and style adjustments you need.

About Dan Mossop

Dan is a Scottish-born web developer, now living in Brisbane with his wife and son. He has been sharing tips and helping users with Divi since 2014. He created Divi Booster, the first Divi plugin, and continues to develop it along with 20+ other Divi plugins. Dan has a PhD in Computer Science, a background in web security and likes a lot of stuff, 

10 Comments

  1. Hello, i try to change height but there is no change, pictures stay croped

    Reply
    • Hi Alina,

      The CSS given in this post adjusts the size that the image displays in the browser. However, in your case, it looks like the image is being cropped on the server before it is sent to the browser.

      I think you should be able to sort it out if you follow the instructions in this post:

      https://www.eleganttweaks.com/divi/changing-portfolio-blog-module-thumbnail-sizes/

      (Use the code block at towards the end of the post that is designed for the portfolio module).

      I see you've also got Optimole doing some processing of the images. If the above post doesn't fix the issue, try temporarily disabling Optimole to check whether or not it is resizing the images.

      Reply
  2. Hi! I have added the CSS necessary to change the size of my portfolio thumbnails however while the box around the image is showing square, the images themselves are still cropping.

    Reply
    • Hi Devin, is there any chance you're able to send me a link to the page with your portfolio so that I can take a look? Thanks!

      Reply
      • Hi dan

        I'm running into the same issue. Could you let me now how this was resolved? Only 3 out of the 6 squares are cutting off for me.

        Thank you

        Reply
        • Hey Melanie, I'm not sure if this one was resolved. Any chance you can send me a link to the affected page so that I can try to find a solution for you? Thanks!

          Reply
  3. Hi, I used your code and et_portfolio_image was change right but not img itself – it´s still cut off as before. Any idea? Thanks.

    Reply
    • Hi Tomas, are you able to send me link to the page you're working on so that I can take a look? Thanks!

      Reply
  4. Hello Dear,

    Is there a way I can show my blog's categories on top of my blog, like a filter?

    I want to implement the same design of filterable portfolio, but instead, not for the portfolio, but for my blog posts.

    Reply
    • Hi Muhammad,

      ​The only way I know how to do it is with the Porfolio Posts Pro plugin. ​It adds three new Divi Builder modules, one of which is the "DP Filterable Blog" module. That module does exactly what you're describing – it displays blog posts using the same design as the filterable portfolio and adds the categories as a filter.

      Hope that helps!

      Reply

Submit a Comment

Comments are manually moderated and approved at the time they are answered. A preview is shown while pending but may disappear if your are cookies cleared - don't worry though, the comment is still in the queue.

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

We may earn a commission when you visit links on our website.

Latest From Divi Booster

Enable Automatic Looping for YouTube Videos in the Divi Video Module

Enabling automatic looping for YouTube videos in your Divi video module ensures that content plays seamlessly and continuously without interruption. This feature can enhance user engagement, highlight key information, or create dynamic visual effects on your website....

Hide Video Controls in Divi Video Module

Disabling YouTube video controls in the Divi Video Module helps create a seamless, distraction-free viewing experience for your site visitors. This approach is useful when you want full control over how your video content appears and is interacted with on the page, or...

Mute YouTube Videos by Default in the Divi Video Module

In the Divi Video Module, starting your YouTube videos muted by default can create a more user-friendly browsing experience on your webpage. It is particularly beneficial for reducing distractions, enhancing visitor engagement, and providing a seamless content preview...

Autoplay Videos in Divi Video Module

Enabling videos in your Divi video module to start playing automatically can enhance both the site's design and user engagement. To ensure full compatibility with browser requirements, such as Chrome's autoplay policy, it's often necessary to start your videos muted...

How to Add the Post Status in Divi's Dynamic Content

Divi's Dynamic Content feature is great for enhancing your post/page templates with post-specific information. While Divi includes an option to show information such as the Post Created Date using Dynamic Content, there is no equivalent option for the Post Status....

Random Divi Posts