';?> ]+src=[\"'](s?https?:\/\/[\-_\.!~\*'()a-z0-9;\/\?:@&=\+\$,%#]+\.(jpg|jpeg|png|gif))[\"'][^>]+>/i", $post->post_content, $matches); if(isset($matches [1] [0])){ echo '<'.( (is_amp() )?'amp-img layout="responsive"':'img').' src="'. esc_url($matches [1] [0]) .'" width="640" height="480" alt="'.get_the_title().'" />'; }else{ echo '<'.( (is_amp()) ?'amp-img layout="responsive"':'img').' src="'. esc_url(get_template_directory_uri()) .'/assets/images/no_image.png" width="640" height="480" alt="No image available" />'; } }else{ //the_post_thumbnail(array(640, 480)); $thumurl = wp_get_attachment_image_src( get_post_thumbnail_id() , 'medium' ); echo '<'.( (is_amp() )?'amp-img layout="responsive"':'img').' src="'.esc_url($thumurl[0]).'" width="'.esc_attr($thumurl[1]).'" height="'.esc_attr($thumurl[2]).'" alt="'.get_the_title().'" title="'.get_the_title().'" />'; } ?> term_id )) . '" class="post_card_category">' . esc_html($category[0]->cat_name) . ''; } ?>