
It’s nice when we write good content. It’s even better when a reader shares it on sites such as facebook or twitter. One problem with sharing on facebook is that facebook will try to pull in images from the site but may not always pull in the one you want. You can control what images show up with a special meta tag. This will make the one you pick as the first image, but unfortunately not the only image. This is still useful if you post only a youtube video in your post or page and want to specify an image for when shared on facebook. Facebook has a set of share tags available.
To specify an image I first upload it using the Media->Add New wordpress page and grab the URL of the image after I upload it. Next, while on the page or post scroll down to the Custom Fields area. The first time you will need to add a new field. Call it image_src and to the right paste in the full path to the image you just uploaded. Save the post. Next, add the code below one time to your Thesis theme’s custom_functions.php file.
Here is the link to the text file with the Thesis code to add to custom_functions.php.
That’s it! Pretty simple huh? Leave a comment if you have any questions or comments. Thanks for reading!
Just a tip for anyone else who might experience the same issue – I couldn’t get this function to actually pull the right image until I put it at the *top* of the custom_functions file.
.-= Carrie Isaac´s last blog ..August drink specials at Dutch Bros Coffee =-.
I followed your directions, but this still does not work on my blog. I’ve tried other solutions as well, such as: http://www.wolf-howl.com/blogs/thesis-digg-facebook/. I can’t for the life of me figure out what I’m doing wrong… 🙁
My blog url is http://ustandout.com; please let me know if you have any suggestions. Thanks!
Diana
@dianafreedman
.-= Diana Freedman´s last blog ..How to Choose a Blog Publishing Application =-.
Diana,
Did you add the meta tag in when you added the post? You have to do this for each post that you want to specify the image to use when people share your content.
Yes I did, I added a new custom field for image_src with the image URL.
.-= Diana Freedman´s last blog ..How to Choose a Blog Publishing Application =-.
I’m having the same problem; it certainly seems like one of these solutions will work, but they are not. Interestingly, when I look at the source code for the post in question, I see that that there is not fb_meta tag added into the head. Perhaps I have to create a NEW post for this to act on it, and it won’t do this for the ones I’ve already created?
I tried adding a new test post and looked at the source, and unfortunately, the link rel= I’m hoping to see is still not there. The php is not adding it. Then I tried moving the new php to the top of the custom_functions.php and that didn’t help, either.
Back to the drawing board, I guess, unless someone here has a solution. The site is http://www.rootsmkt.com, and the post in question is the new pukka herbs teas off the front page.
Will this also work for a page, rather than a post, as I see the code specifies ‘post’. Should it be changed to page or should it work anyway?