通常,facebook share会从网站上获取一张图片进行发布,并将其显示为缩略图。
如果你在我的测试页面中按“在facebook上共享此内容”链接,则不会。
这是我的测试站点:http://alexchen.info/taiwantalk/
代码如下:
<?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( __( \'← Older posts\', \'twentyten\' ) ); ?>
<?php previous_posts_link( __( \'Newer posts →\', \'twentyten\' ) ); ?>
<?php endif; ?>
</div><!-- #mainbar -->
</div><!-- .container -->
</div><!-- #content-bottom -->
<?php get_footer(); ?>
EDIT:
我添加了所有必要的元标记和链接:
<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" />
但这是唯一显示的:
asdasd |台湾谈话http://alexchen.info/taiwantalk/2011/03/...
您可以使用以下HTML标记和属性:
有什么建议吗?