希望你们一切顺利,我需要你的帮助,因为我在我的wordpress网站上遇到问题,当我在我的facebook页面上发布我的网站网址时,它显示了一个我不想要的随机图像 < / p>
在此图片中,您可以轻松了解我正在谈论的问题,我希望代替空间图像显示网站的标识,请任何人帮助它,提前谢谢
答案 0 :(得分:0)
您可以使用此插件修复问题https://wordpress.org/plugins/facebook-thumb-fixer/,也可以按照http://www.wpbeginner.com/wp-tutorials/how-to-fix-facebook-incorrect-thumbnail-issue-in-wordpress/
进行操作如果您没有得到任何解决方案,请告诉我。感谢
答案 1 :(得分:0)
尝试使用OpenGraph图像标记
<meta property="og:image" content="link to your logo" />
答案 2 :(得分:0)
您需要在header.php
中打开图表标记。我通常使用这种组合:
<?php
$theme = wp_get_theme();
$screenshot_url = esc_url( $theme->get_screenshot() );
if ( is_home() ): ?>
<meta property="og:url" content="<?php echo get_home_url(''); ?>" />
<meta property="og:type" content="website" />
<meta property="og:title" content="<?php echo get_bloginfo('name'); ?>" />
<meta property="og:description" content="<?php echo get_bloginfo('description'); ?>" />
<meta property="og:image" content="<?php echo $screenshot_url; ?>" />
<?php elseif( is_category() ):
$cat_id = get_query_var('cat');
$cat_name = get_cat_name($cat_id);
$cat_desc = (category_description( $cat_id ) != '') ? category_description( $cat_id ) : get_bloginfo('description');
?>
<meta property="og:url" content="<?php echo get_category_link($cat_id); ?>" />
<meta property="og:type" content="website" />
<meta property="og:title" content="<?php echo $cat_name; ?>" />
<meta property="og:description" content="<?php echo $cat_desc; ?>" />
<meta property="og:image" content="<?php echo $screenshot_url; ?>" />
<?php else: ?>
<meta property="og:url" content="<?php the_permalink(); ?>" />
<meta property="og:type" content="website" />
<meta property="og:title" content="<?php echo get_the_title(); ?>" />
<meta property="og:description" content="<?php echo get_the_excerpt(); ?>" />
<?php if(has_post_thumbnail()):
$url = wp_get_attachment_url( get_post_thumbnail_id() );
?>
<meta property="og:image" content="<?php echo $url; ?>" />
<?php else: ?>
<meta property="og:image" content="<?php echo $screenshot_url; ?>" />
<?php endif; ?>
<?php endif; ?>
我为家庭,类别和其他页面添加了单独的OG标记,并回退到主题图像(这可以防止选择随机图像)。
希望这有帮助。
答案 3 :(得分:0)
试试这个:
<meta property="og:image" content="<?php the_post_thumbnail(); ?>" />
<meta property="og:title" content="<?php the_title(); ?>" />
<meta property="og:description" content="<?php the_content(); ?>" />
<meta property="og:site_name" content="<?php bloginfo('name'); ?>" />
<meta property="og:type" content="article" />
<meta property="og:locale" content="en_US" />
<meta property="og:url" content="<?php the_permalink(); ?>" />
<meta property="og:title" content="<?php the_title(); ?>" />
<meta property="article:published_time" content="<?php echo get_the_time(); ?>" />
<meta property="article:modified_time" content="<?php the_modified_date(); ?>" />
<meta property="article:author" content="<?php the_author(); ?>" />
<meta property="article:section" content="Featured" />
<meta property="article:tag" content="<?php the_tags(); ?>" />
http://happybloggerplaza.com/how-to-fix-thumbnail-image-facebook/ https://wordpress.org/plugins/facebook-thumb-fixer/other_notes/