global $post;
$firstIMG = ”;
$resultSET = preg_match_all(‘/<img.+src=[\'"]([^\'"]+)[\'"].*>/i’, $post->post_content, $allIMAGES);
$firstIMG = $allIMAGES[1] [0];
$firstIMG = ”;
$resultSET = preg_match_all(‘/<img.+src=[\'"]([^\'"]+)[\'"].*>/i’, $post->post_content, $allIMAGES);
$firstIMG = $allIMAGES[1] [0];
if(empty($firstIMG ))
{
$firstIMG = “path to custom image”;
} else {
echo $firstIMG;
}
{
$firstIMG = “path to custom image”;
} else {
echo $firstIMG;
}
No comments:
Post a Comment