User profile in front-end

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..

Topic profiles front-end pages users Wordpress

Category Web


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.


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' ); ?>

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.