Hi there,
I have set the height and width because that’s the size I would like them to be on the homepage. Is there a better way to change these attributes so that they match the container size?
You can keep the WPSP’s image height and width field empty and assign the sign through custom CSS.
Example:
/* size on desktop and small tablets */
@media(min-width:769px){
.wp-show-posts-image {
height: 200px;
width: 300px;
}
.wp-show-posts-image img {
object-fit: cover;
}
}
/* size on mobile */
@media(max-width:768px){
.wp-show-posts-image {
height: 400px;
width: 500px;
}
.wp-show-posts-image img {
object-fit: cover;
}
}
After this, you can consider registering new image sizes for mobile (if the default generated sizes are inadequate), and then regenerate the image for the newly registered image sizes.