我使用此插件在标题中回显帖子特色图片的URL:
<?php
/** Plugin Name: Post Thumbnail FB header */
function fb_header()
{
// Not on a single page or post? Stop here.
if ( ! is_singular() )
return;
$post_ID = get_queried_object_id();
// We got no thumbnail? Stop here.
if ( ! has_post_thumbnail( $post_ID ) )
return;
// Get the Attachment ID
$att_ID = get_post_thumbnail_id( $post_ID );
// Get the Attachment
$att = wp_get_attachment_image_src( $att_ID );
printf(
\'<link rel="image_src" href="%s" />\'
,array_shift( $att )
);
}
add_action( \'wp_head\', \'fb_header\' );
?>
就目前的情况来看,它是echo的特色图像。我想它回显的特色图像的大版本的URL。How can I do this? 请注意,我所有的特色图片都有一个大版本。。。