Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
add_filter( 'wp_calculate_image_sizes', 'lc_content_archive_thumbnail_image_sizes', 10, 5 );
* Change the default "sizes" attribute created by WordPress
* for the content archive thumbnails
function lc_content_archive_thumbnail_image_sizes( $sizes, $size, $image_src, $image_meta, $attachment_id ) {
if( is_archive() && is_main_query() || is_home() ) {
$sizes = '(min-width: 769px) 150px, 100vw';
return $sizes;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment