All images are not displayed in facebook share button

前端 未结 1 2158
情深已故
情深已故 2021-02-19 11:39

I am having one problem in my Facebook share button.

I have 8 images in my current post and all the images are greater than the size of 200x200.

But when i clic

相关标签:
1条回答
  • 2021-02-19 11:51

    This is a great question, but I think the answer can disappoint you.

    Short answer: far I know and searched, you can't do that.
    Long answer: you can optimize this scenario with some good static images - or if you can be more creative, dinamically images.


    The first tip

    Add a static image to every share. You can do that adding Open Graph Meta Tags inside your head section of HTML:

    <meta property="og:image" content="http://www.myawesomesite.com/logo.jpg"/>
    

    With the code above you'll say to Facebook always show this image as an option in Share button. According to Facebook documentation is recomended use images with at least 1200 x 640 pixels, because this will share a post with a large image.

    Following is the preview of one post with the recomended dimensions: enter image description here

    And now a post with a small image: enter image description here

    The second tip

    In this post I found a possible good solution for your problem. The author used the same principles of the previous tip, but he used another practical way to do that.

    He used the following tag:

    <link rel="image_src" href="http://myawesomesite.com/logo.png" />
    

    This tag is almost the same the previous one, but I think rel="images_src" can be a interesting thing. The link tag is applied in the head section of the website too (acording to W3C page), but I think you can lie to Facebook, because they're bad guys and don't provide a good API.

    I was wondering - and this is just a supposition - why not try apply image_src as ID of your post / website images? I can't test this currently, but for now is the best thing I can think.


    Conclusion:

    Facebook isn't very good in a lot of different ways, and they don't provide everything we need - like this interesting function. But maybe we can fool the Facebook using some strange techniques.

    If you don't want test things like this, the only way you can choose images to share is giving to your page the static OpenGraph Meta Tags of the first tip.

    I expect it helped something - sadly I think this is the best answer for your question.

    0 讨论(0)
提交回复
热议问题