0
function find_the_number() {
  global $post, $posts;
  $first_number = '';
  ob_start();
  ob_end_clean();
  $output = preg_match_all('/^[0-9,]+$/', $post->post_content, $matches);
  $first_img = $matches [1] [0];

  if(empty($first_img)){ //Defines a default image
    $first_img = "/images/default.jpg";
  }
  return $first_img;
}
  • 1
    What's your question? – WebElaine Mar 20 at 13:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.