Ad - Web Hosting from SiteGround - Crafted for easy site management. Click to learn more.

How to Change Portfolio or Project Gallery Image Sizes for Divi

Unfortunatly, you cannot change the sizing of gallery images for the portfolio grid in the CSS file. In this particular case, it’s just a few lines of PHP code you’re going to throw into your child themes functions.php file. Just make sure the featured images you add are all the same size and you should be good to go. I’ve done many websites for authors and this is a great module to use to display a list of books and organize them by subject.

Another handy SEO trick is to change the URL of the permalink for projects to something more specific. In the particular case of author websites, we would want to change “projects” to “books”. In the code below, simply change “project” to the naming of your choice.

If you don’t know what a child theme is, you should consider using one if you are a professional developer. That way any customizations, such as this one, are never lost with updates to the theme. To learn more about child theme, see the WordPress codex documentation of it or read about it on the Elegant Themes website.

Insert this code in Functions.php

//* Change Image Width and Height for Portfolio Image Gallery
add_filter( ‘et_pb_portfolio_image_height’, ‘portfolio_size_h’ );
add_filter( ‘et_pb_portfolio_image_width’, ‘portfolio_size_w’ );

function portfolio_size_h($height) {
return ‘9999’;
}
function portfolio_size_w($width) {
return ‘9999’;
}

//*Change permalink url for projects
function custom_post_name () {
return array(
‘feeds’ => true,
‘slug’ => ‘project’,
‘with_front’ => false,
);
}
add_filter( ‘et_project_posttype_rewrite_args’, ‘custom_post_name’ );


The following code to modify the url structure of projects was provided by Elegant Tweaks.

Divi portfolio gallery image grid

Sortable portfolio grid for divi using changed images sizes to display a. Gallery of books.

Author: Heather Valencia

Author: Heather Valencia

Web Designer & Developer

I’ve been developing WordPress websites as a freelance web designer in Spokane since 2010. My passion for building websites is as strong as the dedication I put forth in strengthening my client relationships.

If you’ve valued the content I work hard to provide for free, show your appreciation with a cup of coffee or a tip.

Either way, I’m very appreciative that you came here. Share a post and if you think something is lame, email me and let me know.

Consider a donation to my daugther’s business! 🙂

1 Comment

  1. Elena Trevino

    i have a porfolio in divi, but I can’t figure out how to change the portfolio image–and I can’t get out of visual edit to the modular edit. Can you help me.?

    Reply

Submit a Comment

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

Ravenous Raven Design