Archived topic
Feature Image scaling issues
6 replies · Started by Alex on March 27, 2018
Hi Guys,
I'm trying to get get my featured images to fill the entire space even though some are a bit smaller - so i'd like them to stretch but also be responsive.
You can see what I mean by looking here.
https://akorik.com/category/1st-shift/
I've tried this...
/* Set min size of featured image in post */
.page-header-image-single img {
min-width: 1065px;
}
/* Set min size of featured image in post */
/* Set min size of featured image in category */
.post-image img {
min-width: 1065px;
}
/* Set min size of featured image in category */
...and if it was 1990 I'd be happy with it (works fine on a full screen desktop) but not responsive.
I've looked here https://docs.generatepress.com/article/adjusting-the-featured-images/
and didn't get to far.
Any help would very much appreciated.
--Alex
Hi there,
Are you talking about the home page?
If so those are all from Elementor.
Let me know.
Hey Leo,
Thanks for responding.
I'm not talking about the home page.
if you take a look at https://akorik.com/category/1st-shift/ you will notice the post images are different sizes. I would like them to all fit uniformly.
I hope that makes sense.
Thanks again!
Have you tried the resizing option in the customizer? https://docs.generatepress.com/article/adjusting-the-featured-images/
I referenced that link in my original post. I tried using the ui in the customizer. I can make the images smaller then the origional size but I'm unable to strech them to a larger size (larger than original). Is there a way to override this setting?
One other thing I tried from https://docs.generatepress.com/article/adjusting-the-featured-images/
add_filter( 'generate_blog_image_attributes','tu_variable_image_sizes' );
function tu_variable_image_sizes( $atts ) {
// Set up our conditional
if ( is_single() ) {
$atts[ 'width' ] = 300;
$atts[ 'height' ] = 300;
$atts[ 'crop' ] = true;
}
// Return our options
return $atts;
}
which works fine.
but if I try something like this...
add_filter( 'generate_blog_image_attributes','tu_variable_image_sizes' );
function tu_variable_image_sizes( $atts ) {
// Set up our conditional
if ( is_single() ) {
$atts[ 'width' ] = 1065;
$atts[ 'height' ] = 500;
$atts[ 'crop' ] = true;
}
// Return our options
return $atts;
the image wont scale
Any idea why this is? something seems to be blocking me from scaling above 100% of image size.
Unfortunately the WP resizer isn't able to upscale images currently.