Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serve webp / size images responsively #5

Open
5 tasks done
fgeierst opened this issue Dec 25, 2020 · 3 comments
Open
5 tasks done

Serve webp / size images responsively #5

fgeierst opened this issue Dec 25, 2020 · 3 comments

Comments

@fgeierst
Copy link
Owner

fgeierst commented Dec 25, 2020

Originally posted by @fgeierst in #1 (comment)

@fgeierst fgeierst mentioned this issue Dec 26, 2020
8 tasks
@fgeierst
Copy link
Owner Author

fgeierst commented Dec 27, 2020

@fgeierst
Copy link
Owner Author

Load properly size images by adding more media conditions / slot sizes

Set $sizes corresponding to settings in /wp-admin/options-media.php
Note that medium_large (768px) is available, but not displayed in options-media.php

function adjust_image_sizes_attr( $sizes, $size ) {
	$sizes = '(max-width: 500px) 500px, (max-width: 768px) 768px, 1024px';
	return $sizes;
}
add_filter( 'wp_calculate_image_sizes', 'adjust_image_sizes_attr', 10 , 2 );

@fgeierst fgeierst reopened this Dec 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant