简体   繁体   English

在Facebook上共享时,无法为主页(也是商店页面)设置缩略图

[英]Can not set thumbnail for home page (it is also shop page) when sharing on Facebook

My website use the shop page as the front page. 我的网站使用商店页面作为首页。 I already set featured image for that page. 我已经为该页面设置了特色图片。 When I sharing the link of my shop page www.shopgiayhd.com/shop I got the thumbnail as the featured image I set. 当我共享商店页面www.shopgiayhd.com/shop的链接时,我得到的缩略图是我设置的特色图像。 But when I sharing my web link www.shopgiayhd.com , it uses the last product image as the thumbnail. 但是,当我共享我的Web链接www.shopgiayhd.com时 ,它将使用最后的产品图片作为缩略图。

I tried to add the meta property og:image at the <head>...</head> . 我试图在<head>...</head>处添加meta属性og:image。 It works but it affects all other links such as category, single product. 它可以工作,但是会影响所有其他链接,例如类别,单个产品。 I don't want like that. 我不要那样

Please help me. 请帮我。 Thank you so much in advance 提前谢谢你

添加标头if(is_home()|| is_front_page())检查,然后输出og:image仅作为主页。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM