Home Forums Plugin Support WP User Frontend (Free Version) Template User Meta Tags

This topic is: resolved

This topic contains 3 replies, has 2 voices, and was last updated by  Tareq Hasan 5 years, 11 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #5406

    Alexis Media
    Participant
    Post count: 54

    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?

    #5410

    Tareq Hasan
    Keymaster
    Post count: 2831

    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.

    #5413

    Alexis Media
    Participant
    Post count: 54

    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.

    #5417

    Tareq Hasan
    Keymaster
    Post count: 2831

    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 4 posts - 1 through 4 (of 4 total)

The topic ‘Template User Meta Tags’ is closed to new replies.