WordPress.org

Ready to get started?Download WordPress

Forums

Facebook
Wrong image when clicking "Like" for homepage (13 posts)

  1. zep101
    Member
    Posted 1 year ago #

    I have the like button displaying on posts and it works correctly using the right image.

    I also have the like button "show on Home" ticked but it does not show on the home page so I put a like button at the top of my sidebar (using WordPress-front page displays latest posts). When you click "Like" it is displaying the proper homepage url and tagline but is using a random image!

    How do I control the image it uses for the homepage?

    Thanks.

    http://wordpress.org/extend/plugins/facebook/

  2. Niall Kennedy
    Member
    Plugin Author

    Posted 1 year ago #

    The plugin uses your post's featured image for single page views. You can add an image to a homepage or archive view through the fb_meta_tags filter.

  3. zep101
    Member
    Posted 1 year ago #

    Sorry I don't really get it. I have my WP site set up as

    Settings/Reading/Front page displays/Your latest posts
    So the home page is not a page that you can set a featured image.

    Maybe I can edit the "fb_meta_tags filter"? But I don't know where I would do that, is it in one of the editor php files? Which one? Thanks.

  4. sparkymarky
    Member
    Posted 1 year ago #

    Yes, I would like to know where I can find more information about the fb_meta_tags filter. This sounds very useful.

  5. Niall Kennedy
    Member
    Plugin Author

    Posted 1 year ago #

    Custom actions and filters are documented in the Facebook plugin readme
    http://wordpress.org/extend/plugins/facebook/other_notes/

  6. zep101
    Member
    Posted 1 year ago #

    I read through all the material you recommend in the link but I still don't see any indication of where these filters are located. Are they in a php file in my wordpress? Do I find them somewhere on Facebook developer page?

    How do you edit any of them?
    Thanks

  7. Niall Kennedy
    Member
    Plugin Author

    Posted 1 year ago #

    Filters are hooks into WordPress code you can use to customize your own installation.

    I added a new forum sticky explaining WordPress filters with example code. Please let me know if this answers your questions.
    http://wordpress.org/support/topic/customize-open-graph-protocol-for-your-site-or-network

  8. zep101
    Member
    Posted 1 year ago #

    Hi Niall and thanks for the info, I tried doing what it says in the link in the functions.php file and cleared the cached a couple of times but it had no effect.

  9. frons79
    Member
    Posted 1 year ago #

    Hi Niall I've been silently following this thread 'cuz I have the same issue as zep101.
    I've placed had a filter, as u showed in the example, in my funtions.php file and I've set a "featured image" on one post to check if anything was changing with a negative feedback.

    I definitely can NOT force Facebook to choose the "featured image" thumbnail instead of the others shown in each post, very frustrating indeed!

  10. zep101
    Member
    Posted 1 year ago #

    Hi frons, I finally cracked the code for me anyway and it might work for you:

    After much trial and error I think I have fixed the issue. I won't bore you with all the details except to say that I disabled "Facebook open graph" in my plugin SEO by Yoast and I inserted:
    <meta property='og:image' content='http://topexerciseworkouts.com/wp-content/uploads/2012/12/bicep.jpg'/>
    just before the closing head tag in the NomNom header.php

    I am no longer receiving any errors and my like button is showing the correct image! So far so good.

    Maybe you don't have the SEO plugin if not just try pasting the meta property above into your header.php file just above the </head> tag. (of course modify for your own image)

    Good luck!

  11. frons79
    Member
    Posted 1 year ago #

    Thanks zep, I've tried also this way, but not luck at all :(

  12. zep101
    Member
    Posted 1 year ago #

    Be sure that you're clearing your cache if you are using a caching plugin to make sure its not working.

  13. frons79
    Member
    Posted 1 year ago #

    In the end I managed to solve this bug.
    It was easier than I expected, and, as usual in these situations, you always look for the most difficult solutions forgetting the easiest one back.

    For some mysterious reason it seems that OGP only likes thumbnails which dimensions are the same or more than 200 pixels. The fact is that when you upload an image on WordPress and set it as thumbnail, it will be resized to, by WP defaults, 150x150 pixels.

    In my case, the easiest solution was running the Facebook debugger which in turn gave me the ultimate hint on what I was lacking.
    Actually (forgive my hilarious madness) I was definitely lacking in size.

    After running a scan, I got this message:

    Open Graph Warnings That Should Be Fixed

    Small og:image: All the images referenced by og:image should be at least 200px in both dimensions. Please check all the images with tag og:image in the given url and ensure that it meets the recommended specification.

    So I manually enlarged a random thumbnail of one of my previous posts to the actual 200x200 pixel size and tadadah!!! Size DOES matter!

    Facebook now shares the proper link and proper image also from WP homepage or single post without hacking any code. Hope this can be of any help to everybody has the same issue!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic