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

  • In a page template use <?php global $current_user; var_dump($current_user); ?>. For example: <?php the_author_meta( 'first_name', $current_user->ID ); ?>. – Mayeenul Islam Dec 7 '15 at 11:14
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' ); ?>

  • 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 Dec 7 '15 at 12:09
  • Try your-wp-url/?author=1 where 1 is user's ID. – mukto90 Dec 7 '15 at 13:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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