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.

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

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.

Latest Posts

Adjust Lightbox Arrow Size in Divi Gallery

Customize the size of the navigation arrows that appear in your gallery lightbox so they’re easier to see and aligned with your site’s design. Whether you want larger, more accessible controls or a subtler look, setting a precise arrow size creates a more polished...

Change Lightbox Arrow Color in the Divi Gallery Module

Make the lightbox navigation arrows in your Divi Gallery match your brand and stand out against your images by assigning a custom color. This improves visual consistency, enhances accessibility with better contrast, and elevates the overall browsing experience for...

Change the Divi Gallery Module Grid Image Scaling

Divi’s Gallery module offers a great way to showcase images, but it can sometimes stretch or crop them in unwanted ways. This article explains how to manage the module’s image scaling behavior to ensure your images are displayed at the correct size and aspect...

Set Custom CSS IDs for Individual Divi Accordion Items

Assigning unique CSS IDs to specific Divi Accordion items allows for precise control over styling, targeting, and linking within your page content. This ability is particularly useful when you want to apply custom designs or create anchor links to particular accordion...

Enable Swipe Navigation in the Divi Gallery Lightbox

Enabling swipe navigation in the Divi Gallery module's lightbox allows users to seamlessly browse through gallery images by swiping left or right, creating a more interactive and mobile-friendly experience. This functionality can significantly improve user engagement...

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 *.