cath_image function causing blank pages
-
For some reason, the function below in my functions.php in theme folder seems to cause blank pages on saving anything in the admin section. Anyone got a idea what is causing this problem?
<?php function catch_image() { global $post, $posts; $first_img = ''; ob_start(); ob_end_clean(); $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches); $first_img = $matches [1] [0]; if(empty($first_img)){ $first_img = "/images/default.jpg"; } return $first_img; } ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘cath_image function causing blank pages’ is closed to new replies.