WordPress.org

Ready to get started?Download WordPress

Forums

WPBook
[resolved] feature image will not show with wpbook 2.1... (22 posts)

  1. BoatyardBoy
    Member
    Posted 3 years ago #

    I have made all the changes as listed for version 2.1 but my featured images never get displayed on the walls. I get a sad smiley instead :(

    Publish to notes works well but i prefer the way it was before...

    Any ideas?

    Thanks for a great plugin :)

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

  2. johneckman
    Member
    Plugin Author

    Posted 3 years ago #

    @boatyardBoy Sorry to hear it.

    Are you using "featured thumbnail" in the post-edit sidebar to set one of the thumbnails?

    Can you point to one of the sad smiley's you get?

  3. BoatyardBoy
    Member
    Posted 3 years ago #

    I insert the image into the post and also click use as featured image which loads it into the sidebar on the post screen.

    Here it is on my profile:

    http://www.facebook.com/profile.php?id=100001793552778&sk=wall

    Here it is on my page:

    http://www.facebook.com/pages/The-Boatyard-Bar/171271832885224?sk=wall

    I also noticed that it only shows the featured image with notes on my profile and not the page...

    It shows in the app exactly like it used to.

  4. Brooke Dukes
    Member
    Plugin Contributor

    Posted 3 years ago #

    I see the featured image, did something change?

  5. BoatyardBoy
    Member
    Posted 3 years ago #

    On the posts titled "example sad smile" on both the page and the profile it just shows :( smiley, you can scroll down a few posts to see it. I have purposely left it there for you to see.

    I have reverted back to 2.013 presently as i need to get content on.

    Thanks

  6. johneckman
    Member
    Plugin Author

    Posted 3 years ago #

    How big are your post thumbnails / featured images?

    (WordPress settings -> Media)

  7. BoatyardBoy
    Member
    Posted 3 years ago #

    160 x 160 are the thumbnail settings.

    It works perfectly in 2.013.

    I upload the flyer image for the event to the main content area and while the media options are popped up i click "use for featured image" and it loads it into the add post right sidebar, click publish and everything is all good.

    I do it exactly the same in 2.1 and it displays the sad smile instead of the thumbnail in facebook.

    Can you see the sad smiley in facebook on the post "example sad smile" if you follow the title link it shows a larger image of what the thumbnail should look like...

  8. johneckman
    Member
    Plugin Author

    Posted 3 years ago #

    Hmm. In 2.0.13 we weren't using the 'featured image' API at all - we were just grabbing the first available image attached to the post.

    Maybe we can go back to that as an option - but I'd rather get the 'featured image' (or what used to be called "post thumbnail" in 2.9) working - that would let users set it specifically for that purpose.

    Does your WordPress theme show the "featured image" somewhere, or do you only see it in the backend post editor?

  9. BoatyardBoy
    Member
    Posted 3 years ago #

    Ok i have justed tested.

    My theme will take the featured image first, if there is no featured image it takes the first attached image to the post. It can also take from a custom field.

    It does use the plugin "get the image" I don't know if that could be conflicting with wpbook version 2.1 featured images or not.

  10. johneckman
    Member
    Plugin Author

    Posted 3 years ago #

    Hmm. WPBook is trying to use get_the_post_thumbnail() - which should not be impacted by the theme so long as you've defined one for each post.

    http://codex.wordpress.org/Function_Reference/get_the_post_thumbnail

    Maybe WPBook needs to more specifically request it's own size thumbnail?

  11. BoatyardBoy
    Member
    Posted 3 years ago #

    I have defined a featured image thumbnail for every post.

    I have also noticed the same happen on another plugin.

    "wp facebook like" when the like/recommend button is clicked the post it creates in facebook has the same sad smiley face next to it.

    I dont know if maybe there is a conflict or if this was just a coincidence.

  12. tfraley
    Member
    Posted 3 years ago #

    Good day.

    I am having this same issue after I upgraded as well.
    Beofer the upgrade i would select a featured image for every post and that would be used in facebook

    Now there seems to pull a random image not too sure why.

    my blog http://www.thomas.fraley.me/blog
    Facebook. http://www.facebook.com/tfraleyprofile

    I run Arthemia Premium theme.. normaly set two images one main one for my own blog which i do useing the customs feild
    I add Name(Image) Value (/uploads/2011/03/willitblend.jpg) to get my main image then i set that same image as my feature image this way my blog and facebook uses the same iamge.

    Any suggestions on a work around for this for now made a few posts today before i relised this

  13. johneckman
    Member
    Plugin Author

    Posted 3 years ago #

    It's not a coincidence - when the post-to-the-wall doesn't include an image, Facebook instead visits the url and picks an image. FB like does the same thing - if you haven't added the FB metadata identifying which image should be used it picks one.

    How it chooses which one to use I've no idea.

    So the issue is why WPBook is either failing to find the "featured image" for the blog post(s) in question, or WPBook is finding the image but when it tries to post the image as an attachment to the Facebook wall FB ignores it.

  14. tfraley
    Member
    Posted 3 years ago #

    any way of disabling this for the time being until it's fix'd? would rather have no image then the wrong one.

  15. johneckman
    Member
    Plugin Author

    Posted 3 years ago #

    Unfortunately, not really. You could comment out the section which tries to get the post thumbnail but then FB will just grab a random image anyway.

    I will need to add some debugging to try to figure out where this is breaking down.

  16. Bill
    Member
    Posted 3 years ago #

    Thanks for helping me with the ssl problem earlier today. I've also have this problem with the image.

  17. johneckman
    Member
    Plugin Author

    Posted 3 years ago #

    Test the 2.1.2 update.

  18. tfraley
    Member
    Posted 3 years ago #

    OK this worked for me.
    Some notes though. Looking at the check permissions section there is a new permission thats wasn't there caleld "Manage pages" was set to no.

    This produced an error until I regranted permissions for the userID then manage pages got set to yes and it worked.

    Just and FYI

  19. Bill
    Member
    Posted 3 years ago #

    Worked for me, thanks!

  20. Vince LaMonica
    Member
    Posted 3 years ago #

    I'm using 2.2.2 and I'm having this problem as well. But...I'm not using a featured image. I am using WP 3.1's Post Type feature and so my posts are of type "image". They contain an image and the "normal" text post below it. It's for my Project:365 site:

    http://www.vjl365.com
    Facebook app: http://apps.facebook.com/vjlphoto/

    This screenshot shows how my latest post is setup in the backend:

    https://skitch.com/vjl323/r3iec/edit-post-vjl-365-wordpress

    I'm unable to link a pre-existing URL to the featured image; attempting, after the fact, to upload the photo of the day into the "set featured image" section doesn't appear to work as the FB app doesn't update the post with the image. I can try later today [Tuesday] and set the featured image *before* I publish the post. I'd rather WPBook use the image in the 'image' custom field though.

    Thanks in advance for any tips you can provide!

  21. johneckman
    Member
    Plugin Author

    Posted 3 years ago #

    @Vince

    The issue is that WPBook is looking for posts of the type "post" not custom post types like "image."

    Specifically, in wpbook/includes/publish_to_facebook.php you'll find this (at lines 75-77 in the current version):

    if(get_post_type($my_post->ID) != 'post') { // only do this for posts
          return;
        }

    You'd need to modify this, perhaps to:

    if((get_post_type($my_post->ID) != 'post') && (get_post_type($my_post->ID) != 'image')) { // only do this for posts or images
          return;
        }

    The logic here is a negative - if post type is *not* 'post' AND post type is *not* 'image' then return (which means don't post it to facebook).

    If you do that, and you also set the 'featured image' you should get the result you're after, though I haven't tested this myself as I don't have 'image' posts.

    If you want wpbook to use your custom 'image' field, you can either write your own function to filter the 'wpbook_attachment' or you can edit lines 115-128 of publish_to_facebook.php which is where that attachment image gets set - Facebook is expecting a URL reference:

    if (function_exists('get_the_post_thumbnail') && has_post_thumbnail($my_post->ID)) {
          $my_thumb_id = get_post_thumbnail_id($my_post->ID);
          $my_thumb_array = wp_get_attachment_image_src($my_thumb_id);
          $my_image = $my_thumb_array[0]; // this should be the url

    (I took out all the debug blocks - otherwise that's essentially the function which retrieves the URL of the "featured image" for the current post stored in $my_post->ID.

    You can just comment out those lines and add a function which puts the URL of your custom image in the $my_image variable and you should be golden.

    Let me know how it works for you.

    (Unfortunately this is the kind of customization you'll need to reapply when upgrades of WPBook get released. In future versions I may handle the question of "post types" but I'm not sure how to handle the thumbnail issue - I had hoped by using a built in WordPress function like post thumbnails to have covered the broadest set of potential use cases).

    If you did set the "featured image" before posting, WPBook will use it (once you've dealt with the post types issue above).

  22. Vince LaMonica
    Member
    Posted 3 years ago #

    Wow...! Thanks, John, for the great advice, above! For some reason, I didn't get notified of your post so I only saw it now. I haven't applied any of the alterations yet, but I shall [and you/Charity Water will be seeing a donation in a few minutes :) ].

    I did remember on Tuesday evening to upload a featured image with my normal post. Even though the theme doesn't use it to display anything in the front-end, it is provided in the backend so I used it, and the FB Wall post did show the correct thumbnail [which is awesome, since it normally picks a random photo which doesn't correspond to the caption/post posted on FB]. I believe this also means when folks "Like" or "Share" [via other plugins], the correct thumbnail will also be used. Because I hadn't made the modification to the plugin, the featured image didn't get carried over into the FB app itself via WPBook, but I'll go ahead and do that later today, before Thursday's photo of the day is uploaded.

    I've had to edit other plugins for customization stuff, so I'm used to having to be careful upon upgrades. Thank goodness for SVN. :)

    I'll let you know the results of this later Thursday or Friday. Thanks again for the detailed explanation and code examples! They are much appreciated!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags