Viewing 1 replies (of 1 total)
  • I use this php code and it works pretty well:

    preg_match_all( '~<img [^>]* />~', $post->post_content, $pics ); if ( count($pics[0]) > 0 ) { ...THERE IS A PHOTO.... }
      else { if ( stripos($post->post_content, '[gallery') !== false ) { ...THERE IS A GALLERY.... } else { ...NO GALLERY AND NO PHOTO.... } }
Viewing 1 replies (of 1 total)
  • The topic ‘Check image in post or not’ is closed to new replies.