Last active
August 25, 2016 03:35
-
-
Save BeardedGinger/8ed8dafecd7aec406d66a67addf90b4d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
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