Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Usually facebook share gets an image from the site to post and shows it as thumbnails.

If you press the share this on facebook link in my test page it doesn't.

This is my test site: http://alexchen.info/taiwantalk/

This is the code:

<?php
/**
 * Template Name: Front Page
 * @package WordPress
 * @subpackage Prominent
 * @since Prominent 1.0
 */
get_header(); ?>
<div id="tagline">
    <div class="container">
    </div><!-- .container -->
</div><!-- #tagline -->
<div id="content">
    <div class="container">
        <div id="mainbar">
            <?php while ( have_posts() ) : the_post(); ?>
                <div class="content-block-2">
                    <?php the_content(); ?>
                </div>
                <a href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&t=<?php the_title(); ?>" target="blank">Share on Facebook</a>
            <?php endwhile; ?>
            <?php /* Display navigation to next/previous pages when applicable */ ?>
            <?php if (  $wp_query->max_num_pages > 1 ) : ?>
                <?php next_posts_link( __( '&larr; Older posts', 'twentyten' ) ); ?>
                <?php previous_posts_link( __( 'Newer posts &rarr;', 'twentyten' ) ); ?>
            <?php endif; ?>
        </div><!-- #mainbar -->
    </div><!-- .container -->
</div><!-- #content-bottom -->
<?php get_footer(); ?>

EDIT:

I added all necessary meta tags and links:

<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="title" content="Article headline here" />
<meta name="description" content="Article summary here" />
<title><?php
    /*
     * Print the <title> tag based on what is being viewed.
     * We filter the output of wp_title() a bit -- see
     * twentyten_filter_wp_title() in functions.php.
     */
    wp_title( '|', true, 'right' );
?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<link rel="image_src" href="http://alexchen.info/taiwantalk/wp-content/uploads/2011/03/cheating.png" />

But this is the only thing that is shown:

asdasd | Taiwan Talk http://alexchen.info/taiwantalk/2011/03/...

You may use these HTML tags and attributes:

any suggestions?

share|improve this question
    
I have the same issue. I used the URL linter, where the image shows correctly. However, when I link the page the thumbnail does not show. –  user5473 May 18 '11 at 15:01

6 Answers 6

up vote 8 down vote accepted

<meta property="og:image" content="http://alexchen.info/taiwantalk/wp-content/uploads/2011/03/cheating.png" />

Visit http://developers.facebook.com/docs/reference/plugins/like/ and see "Step 2 - Get Open Graph Tags"

There's also a lot of WP plugins out there that can help you to generate Open Graph tags.

share|improve this answer

Facebook caches information about a page when share it. You can use the URL Linter to refresh the cache and see exactly what info FB has on your page. The linter has helped me quite a bit with these issues.

share|improve this answer
    
I had this same issue the other day after updating to a new image, then I noticed today that it shows the new image so I was thinking it must be cached, thanks for verifying that –  jasondavis Mar 20 '12 at 22:24

You need to Add a image source meta tag to the head tag of your document.

<link rel="image_src" href="http://site.com/image.jpg" />
share|improve this answer
    
Still doesn't work please see my EDIT. –  janoChen Mar 21 '11 at 3:19

Open Graph is the way to go! Put the open graph meta tags, and then use Facebook Linter to check if all your data comes through right.

share|improve this answer

Just remove the 'http://www." from the front of the URL as well as the last trailing '/' and it should work. Fixed it for me!

share|improve this answer

I tried the OG Tags and pretty much everything else that has ever been advised all over the internet and none of it worked. It just about drove me crazy, so in the end I wrote my own little bit of amateur code which finally works. It simply posts the Title and the image, with an excerpt onto the users fb wall. It worked for me so I put up a tutorial for it https://www.facebook.com/imperialantiques?v=app_100783790015943

share|improve this answer
    
Sending others off to somewhere you can't even view without jumping through hoops makes very poor answer by Stack Exchange standards. Please consider posting full info here or making it accessible in other way to all visitors of the site. Otherwise it's likely to get deleted. –  Rarst Sep 11 '11 at 15:48
    
An answer should be more than just a link to an external site. Please add a solution. –  toscho May 1 '12 at 20:56

protected by Community May 1 '12 at 19:27

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.