Title: illabilis's Replies | WordPress.org

---

# illabilis

  [  ](https://wordpress.org/support/users/illabilis/)

 *   [Profile](https://wordpress.org/support/users/illabilis/)
 *   [Topics Started](https://wordpress.org/support/users/illabilis/topics/)
 *   [Replies Created](https://wordpress.org/support/users/illabilis/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/illabilis/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/illabilis/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/illabilis/engagements/)
 *   [Favorites](https://wordpress.org/support/users/illabilis/favorites/)

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Facebook Social Plugins] [Plugin: Facebook Social Plugins] og:image is not the post thumbnail](https://wordpress.org/support/topic/plugin-facebook-social-plugins-ogimage-is-not-the-post-thumbnail/)
 *  [illabilis](https://wordpress.org/support/users/illabilis/)
 * (@illabilis)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-facebook-social-plugins-ogimage-is-not-the-post-thumbnail/#post-2614381)
 * Hi
    I want to select wich image apears when i share a post on facebook. But with
   this code, also apear first image…. Please help:) An exemple post on my blog 
   [http://gasparfoto.ro/2012/05/anca-cipri-sedinta-inainte-de-nunta.html](http://gasparfoto.ro/2012/05/anca-cipri-sedinta-inainte-de-nunta.html)
   and the modified code:
 * function AddMetas() {
    if (is_single() || is_page()) { global $post;
 *  echo “<meta property=\”og:site_name\” content=\””.wp_specialchars(get_option(‘
   blogname’)).”\” />\r\n”;
    echo “<meta property=\”og:title\” content=\””.wp_specialchars(
   $post->post_title).”\” />\r\n”; echo “<meta property=\”og:type\” content=\”article\”/
   >\r\n”; echo “<meta property=\”og:url\” content=\””.get_permalink().”\” />\r\
   n”;
 *  if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned
   to it.
    $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id(), ‘thumbnail’);
   echo “<meta property=\”og:image\” content=\””.$thumbnail[0].”\” />\r\n”; } else{
   $imgs = $this->getImages(); if (count($imgs) > 0) { echo “<meta property=\”og:
   image\” content=\””.wp_get_attachment_thumb_url($imgs[0]->ID).”\” />\r\n”; } }}}
 *  function getImages() {
    global $post; $imgs = get_children(‘post_type=attachment&
   post_mime_type=image&post_parent=’.$post->ID); if (is_array($imgs)) { return 
   array_values($imgs); } else { return array(); } }
 *  function LikeButton($content) {
    $options = get_option(‘olussier-facebook-social-
   plugins’);………………………..etc

Viewing 1 replies (of 1 total)