Addthis does not allow you to choose a thumbnail when you share with facebook. This little snippit automatically selects your featured image and uses it when anyone uses addthis to share.
Simply paste the following just after the <head> tag in your header.php file in your wp-content > themes > yourcurrentthemename
<?php if (has_post_thumbnail( $post->ID ) ): ?>
<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), ‘single-post-thumbnail’ ); ?>
<meta property=”og:image” content=”<?php echo $image[0];?>”/>
<?php endif; ?>
I’m on wordpress 3.1.1 and this does the trick for one of my blogs where this is essential. I hope that it helps you guys.
|
|
|
|
|