asuengineering / fultonSchoolsDiviTheme

Fulton Schools Divi Theme for Wordpress. (Child theme, requires the excellent Divi Theme from Elegant Themes.)
1 stars 3 forks source link

Make featured images thumbnails proportional to actual images in grid view #19

Closed bergeson closed 7 years ago

bergeson commented 8 years ago

Add the following code to the functions.php file to force featured images from posts and projects to render as "mini-me" proportional images rather than the default size:


/* force grid view BLOG featured images to be proportional to full size image */

add_filter( 'et_pb_blog_image_width', 'blog_size_w' );
add_filter( 'et_pb_blog_image_height', 'blog_size_h' );

function blog_size_w($width) {
return '9999';
}
function blog_size_h($height) {
return '9999';
}

/* force grid view PORTFOLIO featured images to be proportional to full size image */

add_filter( 'et_pb_portfolio_image_width', 'portfolio_size_w' );
add_filter( 'et_pb_portfolio_image_height', 'portfolio_size_h' );

function portfolio_size_w($width) {
return '9999';
}
function portfolio_size_h($height) {
return '9999';
}
SteveRyan-ASU commented 8 years ago

@bergeson, great work digging this out. Will get it added to the next release.

bergeson commented 8 years ago

I am changing my mind a bit on this one. I think what we actually want is for the images to at least conform to a specific size, or at least height. I used these settings and then my grid had proportional miniature pictures of the featured images, which, in that case, meant my "grid" was really wonky. I know ecee.engineering.asu.edu has some special CSS to make the images and grid line up and show excerpts. We should look into that. Also, maybe the new Divi has more options to control these kind of settings?