Php Echo Wordpress在标题中发布特色图片URL

Php Echo Wordpress在标题中发布特色图片URL,php,image,wordpress,url,header,Php,Image,Wordpress,Url,Header,我想将文章的特色图片URL添加到标题中。当Facebook用户共享Wordpress页面时,标题中会显示以下代码: <link rel="image_src" href="FEATUREDIMAGEURL"> 将返回共享的特定映像。但是,我不知道如何添加该帖子的特色图片的URL。。。你能吗?像这样的东西应该有用,不是吗 <?php if (has_post_thumbnail( $post->ID ) ): ?> <?php $image = wp_ge

我想将文章的特色图片URL添加到标题中。当Facebook用户共享Wordpress页面时,标题中会显示以下代码:

<link rel="image_src" href="FEATUREDIMAGEURL">


将返回共享的特定映像。但是,我不知道如何添加该帖子的特色图片的URL。。。你能吗?

像这样的东西应该有用,不是吗

<?php if (has_post_thumbnail( $post->ID ) ): ?>
<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID )); ?>
<link rel="image_src" href="<?php echo $image[0]; ?>">
<?php endif; ?>


返回的图像是什么?