W3 Total Cache and Facebook Open Graph Errors
-
Hello,
I am trying to get Facebook to share my post correctly by using Open Graph tags in my header.php file.
By that, what I mean is when someone clicks the “Like” button on my post, I want the featured image, description and title to show up on the persons page who “Liked” it.
All I get now is a URL with no description or image.
When I use the debugger at https://developers.facebook.com/tools/debug/ and input the URL to my article – http://www.timkainu.com/oben-tripod-review/ – it gives me a bunch of errors.
But when I turn off W3 Total Cache, everything works fine.
Here are the open graph tags in my header.php file:
<!-- the default values --> <meta property="fb:app_id" content="170151483038653" /> <meta property="fb:admins" content="1570847387" /> <!-- if page is content page --> <?php if (is_single()) { ?> <meta property="og:url" content="<?php the_permalink() ?>"/> <meta property="og:title" content="<?php single_post_title(''); ?>" /> <meta property="og:description" content="<?php echo strip_tags(get_the_excerpt($post->ID)); ?>" /> <meta property="og:type" content="w" /> <meta property="og:image" content="<?php if (function_exists('wp_get_attachment_thumb_url')) {echo wp_get_attachment_thumb_url(get_post_thumbnail_id($post->ID)); }?>" /> <!-- if page is others --> <?php } else { ?> <meta property="og:site_name" content="<?php bloginfo('name'); ?>" /> <meta property="og:description" content="<?php bloginfo('description'); ?>" /> <meta property="og:type" content="website" /> <meta property="og:image" content="http://www.timkainu.com/wp-content/uploads/2011/11/TimKainu_Default_Image.jpg" /> <?php } ?>Please let me know if you need any more info and I’d be glad to supply it.
Thanks,
Tim
The topic ‘W3 Total Cache and Facebook Open Graph Errors’ is closed to new replies.