The “My Account” page allows users to log into the site, edit their individual profiles, and more, directly from the front-end.
This page operates in two modes depending on whether a visitor is logged-in or not.
When a user is not logged in, the “My account” page appears as a login page.
When a user is logged in, the “My Account” page shows their account summary with links that allow managing their items and editing their profiles.
Build the “My account” page
- Navigate to Pages → Add new.
- Give your page a name (e.g., My account).
- Click Save Draft.
You can now design your page using the Block Editor.
Insert user info and a logout link
In the first row of the first column, we will display the user’s login name. In the second column, we will include the logout link.
- Insert the Grid block with two columns.
- In the first column insert the Fields and Text block.
- Click the Add Field or View button.
- Click the User Login field.
- Select The current user or the one being displayed in a View loop option.
- Click the Insert shortcode button.
Your page should look like the following.
Add links to other pages
The “My Account” page usually provides a set of links to other pages which users can use to view and edit resources that they own.
Here are two examples of useful links to have on a “My Account” page:
The “Edit your profile” and “Add a new gym” pages you yet have to create. For now, create text placeholders which you will link a little bit later.
Allow users to manage their items
If your site allows users to submit their own content, it’s great to also provide them with a convenient way to manage their items from the “My Account” page.
For detailed steps, check out the lesson about allowing users to manage their items.
Hide the “My Account” page from visitors
The “My account” page lists the information for the currently logged in user. It means that the content should be hidden from other visitors.
It’s best to make the “My account” page available only for logged-in user.
- Allow users to manage their items
- Restricting access to pages
- Using forms to create an “Edit your profile” page
- Create users and assign them the roles you created
- Grant Privileges to Content Managers
- Creating Forms for Registering Users
- Setting up Custom Roles for Members
- Creating Custom Login Forms
- Controlling Access to Front-End Forms
- Protecting Forms from Spam
- How to Reset Access Settings
- Access Control for Contents Inside Page Content
- Access Control for Fields
- Access Control for Standard and Custom Content Types