Title: Getting custom image
Last modified: August 31, 2016

---

# Getting custom image

 *  [wabbagabba](https://wordpress.org/support/users/wabbagabba/)
 * (@wabbagabba)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/getting-custom-image/)
 * How do I grab a custom image?
 * I knnow this is the part of the code to edit, but don’t know what to modify:
 * //Function for getting the image
    function sharify_catch_that_image() { if ( 
   has_post_thumbnail() ){ $sharify_thumb = wp_get_attachment_image_src( get_post_thumbnail_id(
   $post->ID), ‘full’ ); $sharify_thumb_url = $sharify_thumb[‘0’]; return $sharify_thumb_url;
 *  } else {
    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];
 *  return $first_img;
    } }
 * What does the code have to look like so I can grab a custom Image?
 * Great Plugin, tks for your help.
 * Greetings, Uli
 * [https://wordpress.org/plugins/sharify/](https://wordpress.org/plugins/sharify/)

The topic ‘Getting custom image’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/sharify_358bce.svg)
 * [Sharify Social Share Buttons](https://wordpress.org/plugins/sharify/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/sharify/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/sharify/)
 * [Active Topics](https://wordpress.org/support/plugin/sharify/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sharify/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sharify/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [wabbagabba](https://wordpress.org/support/users/wabbagabba/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/getting-custom-image/)
 * Status: not resolved