0

I want every user to get a profile in the front-end of my website. So I want to visit website.com/user/user-name and view all the information of this user. Is this somehow possible?

I would like to do this without a plug-in. All things I'll found on Google did include a plug-in like Front-End Only Users..

1
  • In a page template use <?php global $current_user; var_dump($current_user); ?>. For example: <?php the_author_meta( 'first_name', $current_user->ID ); ?>. Commented Dec 7, 2015 at 11:14

2 Answers 2

0

You need to do 2 different things to achieve this.

URL Structure:

Getting the URL in your desired format: http://website.com/user/username

By default, user's archive URL is something like this http://website.com/author/username

There is a plugin to change author slug, install this plugin and set the slug to user

Plugin: https://wordpress.org/plugins/rename-author-slug/

[Note: I'm the author of this plugin]

Displaying info:

Customize your author.php file in theme directory and show specific information.

In this file, you can get any of information a user has.

To get a user's display-name, simply use <?php the_author_meta('display_name' ); ?>

Or to get his first name, use <?php the_author_meta('first_name' ); ?>

2
  • 1
    Thanks for your reply. I've tried finding my current author URL, but I'm not able to. I've added an author.php file and copied the author-bio.php from the twentyfiftheen theme, but while visiting /author/username I get an 404.. Do you know why?
    – ronnyrr
    Commented Dec 7, 2015 at 12:09
  • Try your-wp-url/?author=1 where 1 is user's ID.
    – mukto90
    Commented Dec 7, 2015 at 13:15
0

I would do it slightly different. I have a similar case but I created a custom post type with a full custom structure on the profile of that user. Using ACF, I linked the user account to the post in the custom post file. That way you have full control over how the user profile is structured and whatever fields are needed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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