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.Updated Information:
Thanks to Milo I finally 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 wherewas wrong thanks to search?? What's the big difference between those two themes? I'm really desperateMilo and refuse to believe that there is no solution for this issueMathSmath!
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 theThe W3 Cache Plugin and the .htaccess entry of it. When changed I get a "200" error codeis interfering 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'.
After I took out the following of my function.phpsharing progress, I don't get any error messages from the Debugger anymore (only warnings):
/*******************************
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 );
Sharing now seems to work when I copy and paste the URL directly into Facebook but not via the Share or Like button on my blog. I'm not sure if it would help if the above code would be adjusted a bit?! Maybe I needit's quite easy to change the buttons. I'm currently using the iframe versions, I think. Furthermore, sharing doesn't work for all blog posts equally. Not sure why! http://zoomingjapan.com/travel/udo-shrine-in-miyazaki/ (this is one of the blog posts that still won't work ..)
Also, do you think there is a way Scroll down to keep using the W3 Cache plugin without causing those problems?
Please help me out heresee my answer! Thanks Works like a lot in advance for any advice you can give me.charm!