"; } echo " "; */ function getThumb($content) { if( has_post_thumbnail() ){ if(preg_match('//', get_the_post_thumbnail($page->ID, 'thumbnail'), $matchs)){ list($imgwidth, $imgheight) = getimagesize(esc_url( $matchs[1] )); return ""; } } // list($imgwidth, $imgheight) = getimagesize(esc_url( $image[0] )); $pattern="//"; preg_match_all($pattern,$content,$match); if(empty($match[0][0])){ //nothing } else { echo $match[0][0]; } } function blogstartpro_body_classes( $classes ) { // Adds a class of group-blog to blogs with more than 1 published author. if ( is_multi_author() ) { $classes[] = 'group-blog'; } return $classes; } add_filter( 'body_class', 'blogstartpro_body_classes' ); add_filter( 'the_content', 'convert_images_amp' ); function convert_images_amp( $content ) { $content = preg_replace( '#]+[a-z0-9"])[/ ]*>#', "", $content ); $content = getThumb().preg_replace( '#style *= *"[^"\n\r]+"#', "", $content ); return $content; }