Template User Meta Tags

This topic contains 3 reply and 2 voices, and was last updated by Tareq Hasan 10 years, 9 months ago
Viewing 3 Posts - 1 through 3 (of 3 total)
Author Posts
June 29, 2013 at 5:49 am 5406
Tareq Hasan I made a profile edit page and want to use the info on a user profile page. I been using $curauth = get_userdata(intval($author)); echo $curauth->primary_state; But that is not working with the plugin. What template tags do i need to use to show the fields on a users profile?
June 29, 2013 at 3:59 pm 5410
Tareq Hasan Tareq Hasan

Are you sure the $author variable has the author ID?

May be something like this:
[php]
if( isset( $_GET[‘author_name’] ) ) {
$profile_user = get_userdatabylogin($author_name);
} else {
$profile_user = get_userdata(intval($author));
}
[/php]

Now you will have the user id in $profile_user->ID and you can access the meta values.

June 29, 2013 at 11:07 pm 5413
Alexis Media Alexis Media

Are you sure the $author variable has the author ID?

Yes this was working with the default and custom meta fields i was using before.

June 30, 2013 at 12:07 am 5417
Tareq Hasan Tareq Hasan

Are the data are saving correctly with the form and they persists? In that case they should be saving correctly.

You can try echo get_user_meta( $user_id, 'meta_key', true ); format too.

Viewing 3 Posts - 1 through 3 (of 3 total)