Viewing 15 replies - 1 through 15 (of 17 total)
  • I have that same problem on occassion. Would love to know if anyone has an answer.

    Thread Starter nickaster

    (@nickaster)

    Yeah – seems like linked-in uses a similar technique and the images it chooses are often really random. There’s got to be a smarter way of saying “pick me”! in the post body some place…

    Thread Starter nickaster

    (@nickaster)

    Hagop – what’s your URL? we could at least look at eachother’s code and see what’s consistent. I’ve been testing this on other sites and they seem to work all the time.

    Thread Starter nickaster

    (@nickaster)

    Well, I tested a bunch of yours and they seem to be working pretty well. Still digging on mine…

    Thread Starter nickaster

    (@nickaster)

    Okay … so I did some research and found someone says you can force the FB image with code in the meta tags like this:

    <link rel="image_src" href="https://www.triplepundit.com/wp-content/uploads/2011/03/3p.jpg" />

    What’s totally blowing my mind now is that it seems to work SOME of the time, but not all. About half the time, FB takes this little *#()& image from down on my sidebar. Totally blowing my mind!!!

    Interesting.

    I probably won’t bother with the meta tags. But it would be great to know what’s going on in FB’s code that makes this happen.

    I have a similar problem on Reddit (showing the default gravatar image) so it might not be Facebook related.

    I also experienced this on one of my blog site, there are times that when I post my site on FB it’s picking weird images from the sidebar.

    Thread Starter nickaster

    (@nickaster)

    INterestingly – now it seems to be stable. I think that there might be some kind of cache in FB that remembers the bad images. When I went way back in time and “liked” some of my old posts. They all pull the correct image now.

    The new challenge is to figure out how to make that image different for every post.

    I think I know how to do it. I have a custom field called “featured image”. With a little hack coding I think I can tell the meta field to throw that image in the meta tag. If there’s nothing featured, it could grab a default.

    I’ll try and figure out how to code it tomorrow. Biggest pain in the ass is that with a shared header across the site I have to make it smart enough to only put the featured in if it’s a blog post, and not a page or something!

    Thread Starter nickaster

    (@nickaster)

    and yes – other services (reddit, linked in) seem to be using the same method.

    Facebook BOT first find the following meta to fetch the content.. if these info not found then it fetches the page randomly..

    Put this code dynamically on every page where you want FB link button to be appeared

    <meta property=”og:title” content=”title”/>
    <meta property=”og:url” content=”https://www.pie-solutions.com/”/&gt;
    <meta property=”og:image” content=”https://www.pie-solutions.com/images/this.jpg”/&gt;

    Thread Starter nickaster

    (@nickaster)

    Cool! Out of curiosity, what’s the difference between that kind of coding and this, for example:
    <link rel="image_src" href="https://www.triplepundit.com/wp-content/uploads/2011/03/3p.jpg" />

    ie, should I kill that and replace with what you suggested?

    Also, do you know the PHP I should put in there that says basically “only show this stuff if this is a blog entry as opposed to a tag page, or something like that?”

    Thanks!

    Thread Starter nickaster

    (@nickaster)

    Secondary question. It seems that if things like quotes or appostrophes are in the title, facebook screws them up – adds some ascii code in there. Is there a cleaner way to display them?

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Facebook Grabs Strange Image’ is closed to new replies.