You can use this method to include your google+ profile image to search results on your WordPress blog.
All it takes are a few new lines of code to your functions.php file in your theme folder.
You need to allow the users to add their google+ profile link on their wordpress user profile page.
And you need to add the google+ profile author link to the header.php via the filter included in the functions.php
Then you have to make a relation between the Google+ profile and your website.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
// add user profile field: function galink_google_profile() { $galink_contactmethods['galink_profile'] = 'Google+ Profile URL'; return $galink_contactmethods; } add_filter( 'user_contactmethods', 'galink_google_profile', 10, 1); // add link to profile id to get_header() function galink_head_output() { if ( is_single() || is_page() ) // is_singular() { global $post; $galink_author_id = $post->post_author; } $galink_google_profile = get_user_meta($galink_author_id, 'galink_profile', true); if (!$galink_google_profile) return; echo '<link rel="author" href="'.$galink_google_profile.'"/>'."\n"; } add_action('wp_head', 'galink_head_output'); |
Now you need to add your website to your Google+ profile:
https://plus.google.com/u/1/user-id/about/edit/co
This will make the link between your google+ profile and your website, and it works as a kind of authentication.
Test that it is working by entering a page or a post that you authored via:
http://www.google.com/webmasters/tools/richsnippets