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'); // adding the rel=me thanks to yoast function yoast_allow_rel() { global $allowedtags; $allowedtags['a']['rel'] = array (); } add_action( 'wp_loaded', 'yoast_allow_rel' ); // adding facebook, twitter, & google+ links to the user profile function bones_add_user_fields( $contactmethods ) { // Add Facebook $contactmethods['user_fb'] = 'Facebook'; // Add Twitter $contactmethods['user_tw'] = 'Twitter'; // Add Google+ $contactmethods['google_profile'] = 'Google Profile URL'; // Save 'Em return $contactmethods; } add_filter('user_contactmethods','bones_add_user_fields',10,1); ?>