0

I want to add a Google+ author badge to the posts/reviews on my website. This would normally be a simple integration of the code that Google provides: https://developers.google.com/+/web/badge/

However, we have multiple authors so I need to pull out the relevant Google+ link from the admin, depending on who the author of the post is. The URl is currently stored under the "Google Profile URL" field in any user's WP user profile. This is not a default field, but I have used a Google+ plugin that lets you store a user's Google+ profile address as part of their Wordpress user profile.

This is the plugin: http://helpforwp.com/plugins/google-author-link/

The main feature that I'll be using from the plugin is how it inserts a new field into user profile information in Wordpress - it's this field that I want to pull information from.

Can anyone help me do this?

Thanks.

  • The "Google Profile URL"-field is no default field in WordPress. Please edit your question and add every needed detail. – kaiser Mar 4 '13 at 13:39
  • Hi, sorry if this was unclear. I've added a bit more info to the original question. Is there any other information I need to provide? – user2087420 Mar 4 '13 at 14:22
  • 1
    Maybe link to the plugin. – kaiser Mar 4 '13 at 14:23
0

Grab Meta Data

Use get_user_meta() for that. The key is 'galink_profile'.

echo get_user_meta( 'galink_profile', 'put the user ID here', true );

Another option is to get it from the author meta data get_the_author_meta() if you're displaying an author page/archive:

echo get_the_author_meta( 'galink_profile', 'put the user ID here' );

Get user IDs

You can grab the ID from the current user with get_current_user_id().

If it's for a comment, use get_comment_ID().

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.