ID), '', '' ); if ( has_post_thumbnail($post->ID) ) { $socialimg = $src[0]; } else { $socialimg = ''; $output = preg_match_all('//i', $post->post_content, $matches); if (array_key_exists(1, $matches)) if (array_key_exists(0, $matches[1])) $socialimg = $matches [1] [0]; } if(empty($socialimg)) $socialimg = get_template_directory_uri() . '/library/images/nothumb.gif'; return $socialimg; } // facebook share correct image fix (thanks to yoast) function bones_facebook_connect() { echo "\n" . '' . "\n"; echo ''; echo '' . "\n"; global $post; echo '' . "\n"; echo '' . "\n"; echo '' . "\n"; if (is_singular()) { echo '' . "\n"; echo '' . "\n"; } echo '' . "\n"; echo '' . "\n"; } // google +1 meta info function bones_google_header() { if (is_singular()) { echo '' . "\n"; global $post; echo '' . "\n"; echo '' . "\n"; echo '' . "\n"; echo '' . "\n"; } } // add this in the header add_action('wp_head', 'bones_facebook_connect'); add_action('wp_head', 'bones_google_header'); ?>