Title: Help in a function
Last modified: August 19, 2016

---

# Help in a function

 *  Resolved [xuso_pg](https://wordpress.org/support/users/xuso_pg/)
 * (@xuso_pg)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/help-in-a-function/)
 * Hi, I need extract a data into a function but i cant.
    My code is:
 * > function fb_like_thumbnails()
   >  { global $posts; $default = ‘[http://www.vidalowcost.com/wp-content/themes/Elements/img/logo_face.png&#8217](http://www.vidalowcost.com/wp-content/themes/Elements/img/logo_face.png&#8217);;**
   > $content = get_post_meta($post->ID, “cuadrado”, true);**
   >  if (is_single()) {
   >  $thumb = $content; } else $thumb = $default;
   >  echo “<link rel=\”image_src\” href=\”$thumb\” />
   >  }
 * The bold text is the problem don´t return nothing, and I need this value, because
   is my select image for the singles posts.
 * Can you helpme? thanks

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/help-in-a-function/#post-1953894)
 * try `global $post;`
    instead `global $posts;`
 *  Thread Starter [xuso_pg](https://wordpress.org/support/users/xuso_pg/)
 * (@xuso_pg)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/help-in-a-function/#post-1953902)
 * YES! THANKS!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Help in a function’ is closed to new replies.

## Tags

 * [informacion](https://wordpress.org/support/topic-tag/informacion/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [xuso_pg](https://wordpress.org/support/users/xuso_pg/)
 * Last activity: [15 years, 3 months ago](https://wordpress.org/support/topic/help-in-a-function/#post-1953902)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
