ID;
$featured_image = "";
$amp_html = "";
$caption = "";
if( ampforwp_is_front_page() ){
$post_id = ampforwp_get_frontpage_id();
}
if( true == ampforwp_has_post_thumbnail() ) {
if (has_post_thumbnail( $post_id ) ){
$thumb_id = get_post_thumbnail_id($post_id);
$image = wp_get_attachment_image_src( $thumb_id, 'full' );
$caption = get_the_post_thumbnail_caption( $post_id );
$thumb_alt = get_post_meta( $thumb_id, '_wp_attachment_image_alt', true);
if($thumb_alt){
$alt = $thumb_alt;
}
else{
$alt = get_the_title( $post_id );
}
$alt = esc_attr($alt);
if( $image ){
$amp_html = "";
}
}
if ( ampforwp_is_custom_field_featured_image() ) {
$amp_img_src = ampforwp_cf_featured_image_src();
$amp_img_width = ampforwp_cf_featured_image_src('width');
$amp_img_height = ampforwp_cf_featured_image_src('height');
if( $amp_img_src ){
$amp_html = "";
}
}
if( true == $redux_builder_amp['ampforwp-featured-image-from-content'] && ampforwp_get_featured_image_from_content() ){
$amp_html = ampforwp_get_featured_image_from_content();
$amp_html = preg_replace('#sizes="(.*)"#', "layout='responsive'", $amp_html);
}
if( $amp_html ){ ?>