$postActual = get_post(); $tmp_img = get_the_post_thumbnail($postActual->ID,'thumbnail'); if($tmp_img!=""){ // Coger el par·metro src $output = preg_match_all('/src=[\'"]([^\'"]+)[\'"].*>/i', $tmp_img, $imagenes); $FBimage = $imagenes[1][0]; } else{ $output = preg_match_all('/src=[\'"]([^\'"]+)[\'"].*>/i', $postActual->post_content, $imagenes); $FBimage = $imagenes[1][0]; } $FBtitle = strip_tags(get_the_title()); $FBsummary = strip_SpecialTags(sanitize_text_field($postActual->post_content)); $ficheroFB=creaImagenFB($FBimage,300,300); $url=curPageURL(); ?>