$index = get_query_var('index');
$epcl_theme = epcl_get_theme_options();
$post_style = get_query_var('epcl_post_style');
$epcl_module = epcl_get_module_options();
$post_meta = get_post_meta( $post_id, 'epcl_post', true );
$class = $image_alt = '';
// Loop
if( !is_single() ){
$optimized_image = '';
$size = 'epcl_single_standard';
if( $post_style == 'grid' ){
$size = 'epcl_single_related';
}
if( !empty( $epcl_module) && $epcl_module['layout'] == 'grid_posts' ){
$size = 'epcl_single_related';
}
$thumb_url = get_the_post_thumbnail_url($post_id, $size);
// Get optimized image if is assigned one
if( defined('EPCL_PLUGIN_PATH') && !empty($post_meta) && isset($post_meta['optimized_image']) ){
$optimized_image = $post_meta['optimized_image'];
if( !empty($optimized_image) && isset($optimized_image['alt']) ){
$image_alt = $optimized_image['alt'];
}
}
if( !empty($optimized_image) && $optimized_image['url'] ){
$thumb_url = $optimized_image['url'];
}
if( !$thumb_url ){
$class = 'hidden';
}
// Single Post
}else{
$single_size = 'epcl_single_standard';
if( !empty($post_meta) && isset($post_meta['style']) && $post_meta['style'] == 'standard' ){
$single_size = 'epcl_classic_post';
}
if( !empty($epcl_theme) && $epcl_theme['single_post_layout'] === 'standard' ){
$single_size = 'epcl_classic_post';
}
$image_id = get_post_thumbnail_id( get_the_ID() );
$image_alt = get_post_meta( $image_id, '_wp_attachment_image_alt', true);
if( wp_is_mobile() ){
$single_size = 'epcl_classic_post';
}
}
if( !$image_alt ){
$image_alt = get_the_title();
}
if( is_single() && !has_post_thumbnail() ) return;
if( $index == 0){
$epcl_theme['enable_lazyload'] = false;
}
if( is_single() && $post_style == 'fullcover' ){
$single_size = 'epcl_single_standard';
}
?>
About the Author
More than just Coding and Math! Our proprietary, activity-based curriculum with live, real-time instruction facilitates: Problem Solving. Creative Thinking. Grit. Confidence. Communication