Adding Registration Fields to Author Template?

This topic contains 8 reply and 2 voices, and was last updated by paperweight 10 years, 10 months ago
Viewing 8 Posts - 1 through 8 (of 8 total)
Author Posts
June 3, 2013 at 6:43 pm 4493
paperweight 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?
June 3, 2013 at 6:57 pm 4497
Tareq Hasan Tareq Hasan

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.

June 3, 2013 at 7:14 pm 4501
paperweight paperweight

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 🙂

June 3, 2013 at 10:13 pm 4520
paperweight paperweight

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?

June 4, 2013 at 10:53 pm 4558
Tareq Hasan Tareq Hasan

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

June 4, 2013 at 10:58 pm 4559
paperweight paperweight

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 😉

June 4, 2013 at 11:05 pm 4560
Tareq Hasan Tareq Hasan

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.

June 4, 2013 at 11:31 pm 4562
paperweight paperweight

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?

June 6, 2013 at 9:41 pm 4630
paperweight paperweight

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 8 Posts - 1 through 8 (of 8 total)