Fra Gaetano Morreale OFM Convento S. Maria di Gesù "La Gancia" Piazza S. Francesco d'Assisi, 11 90018 - Termini Imerese (Pa) +39 091 8141261 +39 345 9645112
function set_default_image(){
global $post;
$image = str_img_src($post->post_content);
if($image != ""){
echo '' . "\n";
}
}
add_action('wp_head', 'set_default_image');
function str_img_src($html) {
if (strpos($html, ']*src\s*=\s*(["\'])(.*?)\1#im';
preg_match($imgsrc_regex, $html, $matches);
unset($imgsrc_regex);
unset($html);
if (is_array($matches) && !empty($matches)) {
return $matches[2];
} else {
return false;
}
} else {
return false;
}
}