Change image sizes using filter

In a typical GeneratePress setup, the image sizes are set in the customizer and apply to all “post” type posts. Using conditional logic, this filter sets the image sizes for other areas of the site, such as custom post type archives, taxonomies, etc.

add_filter( 'generate_blog_image_attributes','kpry_variable_image_sizes' );
function kpry_variable_image_sizes( $atts )
{
    // Set up the conditional
    if ( is_post_type_archive() || is_tax() ) :
        $atts[ 'width' ] = 600;
        $atts[ 'height' ] = 600;
        $atts[ 'crop' ] = true;
    endif;

    // Return our options
    return $atts;
}