Title: WP Admin thumbnails
Last modified: August 19, 2016

---

# WP Admin thumbnails

 *  [gabrielmerovingi](https://wordpress.org/support/users/gabrielmerovingi/)
 * (@gabrielmerovingi)
 * [16 years, 12 months ago](https://wordpress.org/support/topic/wp-admin-thumbnails/)
 * Hey
 * When you upload a picture to the media library, WP generates a thumbnail (size
   set by you) that itself uses when you look inside your media library.
 * Is there a way to extract that? I am using a catch-that-first-image-in-the-post
   function but I dont know PHP that well and I wanted to know if there is a better
   way to do it.
 * The function I use is:
 *     ```
       function catch_that_image() {
         global $post, $posts;
         $first_img = '';
         $nothumb = get_bloginfo('template_directory');
         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)){ //Defines a default image
           $first_img = "$nothumb/images/default.jpg";
         }
         return $first_img;
       }
       ```
   
 * Can it be changed to load the thumbnail of the first image instead?
    Thanks in
   advance.

The topic ‘WP Admin thumbnails’ is closed to new replies.

## Tags

 * [first image](https://wordpress.org/support/topic-tag/first-image/)
 * [load](https://wordpress.org/support/topic-tag/load/)
 * [media](https://wordpress.org/support/topic-tag/media/)
 * [thumbnail](https://wordpress.org/support/topic-tag/thumbnail/)

 * 0 replies
 * 1 participant
 * Last reply from: [gabrielmerovingi](https://wordpress.org/support/users/gabrielmerovingi/)
 * Last activity: [16 years, 12 months ago](https://wordpress.org/support/topic/wp-admin-thumbnails/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
