How to Change Portfolio or Project Gallery Image Sizes for Divi

by Heather Valencia | Jun 5, 2018 | How To, Divi Theme

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.

Want this done for you?

I build SEO, web design and Google Ads systems for businesses that want to own their market.

On this page

Free tool

SEO ROI calculator

Estimate what organic search could be worth to your business before you spend a dollar.

Heather Valencia

Written by

Heather Valencia

Founder & Marketing Systems Architect, Ravenous Raven Design

I've been designing and ranking websites for 18 years. Everything I write here comes from work I do for clients: SEO strategy, Google Ads, competitive analysis and WordPress builds.

Comments

Questions about this guide?

Ask below and I'll answer. Your email won't be published.

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 *

Next step

Rather have it done for you?

Book a 30-minute call. I'll look at where you rank today and tell you what I'd fix first.