Support » Plugin: Facebook Like Button for Dummies » [Plugin: Facebook Like Button for Dummies] Add Use Featured Image? to options

Viewing 1 replies (of 1 total)
  • Fixed it myself. Here’s the code.

    Kermit Woodall
    [ Signature moderated. ]

    ` private function getImage() {
    global $post;
    $thumb =”;
    if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
    $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), ‘large’ );
    return $thumb[‘0’];
    }
    else if (is_single() || is_page()) {
    $imgs = get_children(‘post_type=attachment&post_mime_type=image&post_parent=’.$post->ID);
    if (is_array($imgs) && !empty($imgs)) {
    return wp_get_attachment_thumb_url(current($imgs)->ID);
    } else if ($img = $this->getFirstImage()) {
    return $img;
    }
    }
    return $this->openGraphImage;
    }

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Facebook Like Button for Dummies] Add Use Featured Image? to options’ is closed to new replies.