Home Forums Plugin Support WP User Frontend Pro Adding Registration Fields to Author Template?

This topic is: not resolved

This topic contains 8 replies, has 2 voices, and was last updated by  paperweight 5 years, 11 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #4493

    paperweight
    Participant
    Post count: 122

    Is there information about how I can place the meta fields from the Registration form on the Author Template?

    I am trying to use code like this <h2><?php echo get_user_meta( $user_id, 'company_registration_name', true ); ?>x</h2> but it fails to load on the author.php template. Any ideas why?

    #4497

    Tareq Hasan
    Keymaster
    Post count: 2831

    This fails because the variable $user_id doesn't have the current authors user id.

    I don't know how your author.php is coded, but this way you can get the user details:
    [php]
    if( isset( $_GET[‘author_name'] ) ) {
    $profile_user = get_userdatabylogin($author_name);
    } else {
    $profile_user = get_userdata(intval($author));
    }
    [/php]
    Now echo get_user_meta( $profile_user->ID, 'company_registration_name', true ); should print your custom field. Even echo $profile_user->company_registration_name; might print your company name.

    #4501

    paperweight
    Participant
    Post count: 122

    Ahh, ok my template had this:

    if(isset($_GET['author_name'])) :
    $curauth = get_userdatabylogin($author_name);
    else :
    $curauth = get_userdata(intval($author));
    endif;

    I changed to what you suggested and it works now. Great ๐Ÿ™‚

    #4520

    paperweight
    Participant
    Post count: 122

    Hmmm, but then when I add this it echos no information:

    <?php echo get_user_meta( $profile_user->ID, 'user_url', true ); ?>

    the user_url is the correct metakey that WPUF uses when using the “Website” from the Profile Field in the Registration Form, correct?

    #4558

    Tareq Hasan
    Keymaster
    Post count: 2831

    Yes, WP stores the profiles URL field in that meta key

    #4559

    paperweight
    Participant
    Post count: 122

    Ok, then things are getting confusing. I am using Theme My Login and the URL fields for that and the Profile field for WPUF seem in conflict and confusing. I am trying to figure it all out now — I'm sure it is a simple solution but it is troublesome right now ๐Ÿ˜‰

    #4560

    Tareq Hasan
    Keymaster
    Post count: 2831

    There's nothing confusing. The “Website” field is the same what you see in /wp-admin/profile.php form. It also stores the URL in user_url custom field.

    #4562

    paperweight
    Participant
    Post count: 122

    Right, but here is the situation:

    1) In the Registration Form I created with WPUF, I have a “User URL: Company Website” field.

    2) When a user registers from the frontend, they see a field called “Company Website” and they enter their details, such as http://www.yahoo.com

    3) And after they login, they can adjust their profile's details from the frontend at http://www.mywebsite.com/profile

    4) But when I login to PHPmyuadmin, I only see a field called “company_website” and that is populated by the info from registration in #1 and #2 above.

    5) The details in the Profile Edit page in #3 above are not the same as #1/#2, and when I try echoing user_url I get nothing, but when I echo company_website I do return the value from #1/#2 above.

    So my problem is where is user_url? And why are the details in #3 different?

    #4630

    paperweight
    Participant
    Post count: 122

    Ok, I found the problem. There is a conflict with the WATS plugin and WPUF somehow. I am unclear how it conflicts, but I found info in the mysql and deleted the data. I will continue to troubleshoot.

Viewing 9 posts - 1 through 9 (of 9 total)

The topic ‘Adding Registration Fields to Author Template?’ is closed to new replies.