**** LATEST UPDATE (June 13th 2012)**
I can't figure out what's wrong with my codes. When I want to share one of my blog posts and use either the Facebook share button or copy the link of the blog post directly into Facebook all that pops up is the URL itself, not the meta info such as description or featured image! I filled out the meta data for each and every post and I also added Open Graph to my code.
Yet, when I try to share my blog post links on Facebook, neither the meta description nor a thumbnail would show up for the majority of my blog posts. It's like something is blocking the information. I've run out of ideas. I really hope you guys can help me figure out what's wrong! (obvioulsy I replaced the fillers above with my own data!)
I also used the Facebook Debugger and all it tells me is:
Can't Download: Could not retrieve data from URL.
An example for a blog post that can't be shared properly: http://zoomingjapan.com/favorite-photos/yumebutai/
There are very few blog posts that work with Facebook. If I copy the URL of one of those into the Debugger I still get an error message, though:
Object Invalid Value: Object at URL 'http://zoomingjapan.com/travel/mount-koya-travel-report/' of type 'article' is invalid because the given value '377035309011137' for property 'fb:admins' could not be parsed as type 'fbid'.
The URL above is that of a blog post that could be shared properly, but yet gets an error message.
Thanks to Milo I was able to figure out that it has actually to do with my theme. When I change the theme it suddenly works! My parent theme can share properly, too: http://wordpress.site5.net/alltuts/ So, now I try to figure out WHAT in my theme is causing this error. I have no idea how to figure that out. Any ideas? :/
I replaced the header.php, footer.php, single.php and the function.php (which were the most suspicious to me) with the ones of the TwentyEleven theme of Wordpress. The problem stayed. This means it must be another theme file that is causing those issues. I keep searching for it, but I really don't know what I'm looking for :(
Here's my htaccess file: http://pastebin.com/p4dRk0Gq
I tried to replace one file after another again. Nothing. However, I noticed something else! When switching themes it works fine with TwentyEleven, but I have the exact same issue with the TwentyTen theme! Maybe that gives us a clue where to search?? What's the big difference between those two themes? I'm really desperate and refuse to believe that there is no solution for this issue!
Here's my header.php: http://pastebin.com/EPuNLtvH
Updated Information: Ok, thanks to MathSmath we could figure out that this whole situation has something to do with the Cache Plugin and the .htaccess entry of it. When changed I get a "200" error code with the Debugger of Facebook along with the following error message:
Object Invalid Value: Object at URL 'http://zoomingjapan.com/travel/momoyama-castle-kyoto/' of type 'article' is invalid because the given value '377035309011137' for property 'fb:admins' could not be parsed as type 'fbid'.
Sharing on Facebook works now in some cases. The title and meta description appear, but the thumbnail just won't load. It seems to keep looking for something, but nothing is loading. Any idea how to solve that? Depending on the blog post, it still doesn't work.
Also ... I want to keep using the Cache plugin, is there a chance to get it to work with the Facebook Sharer? ..
EDIT: Also, I took this out of my function.php! I don't get any error messages from the Debugger anymore (only warnings), but sharing still doesn't work:
/*******************************
FACEBOOK OPEN GRAPH
********************************/
//Adding the Open Graph in the Language Attributes
function add_opengraph_doctype( $output ) {
return $output . ' xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml"';
}
add_filter('language_attributes', 'add_opengraph_doctype');
//Lets add Open Graph Meta Info
function insert_fb_in_head() {
global $post;
if ( !is_singular()) //if it is not a post or a page
return;
echo '<meta property="fb:admins" content="377035309011137"/>';
echo '<meta property="og:title" content="' . get_the_title() . '"/>';
echo '<meta property="og:type" content="article"/>';
echo '<meta property="og:url" content="' . get_permalink() . '"/>';
echo '<meta property="og:site_name" content="Zooming Japan - Your Personal Japan Guide"/>';
if(!has_post_thumbnail( $post->ID )) { //the post does not have featured image, use a default image
$default_image="http://zoomingjapan.com/wp-content/themes/alltuts/images/linkback_600x156ver2.jpg"; //replace this with a default image on your server or an image in your media library
echo '<meta property="og:image" content="' . $default_image . '"/>';
}
else{
$thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'medium' );
echo '<meta property="og:image" content="' . esc_attr( $thumbnail_src[0] ) . '"/>';
}
echo "\n";
}
add_action( 'wp_head', 'insert_fb_in_head', 5 );
Please help me out here! Thanks a lot in advance for any advice you can give me.