> For the complete documentation index, see [llms.txt](https://wplake.gitbook.io/advanced-views/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wplake.gitbook.io/advanced-views/field-sources/user-profile.md).

# Displaying fields from a User profile

{% hint style="info" %}
In WordPress, User profiles can also have custom fields - usually created with ACF, MetaBox, or Pods. Advanced Views allows you to display them.
{% endhint %}

In Advanced Views, [*Layout*](/advanced-views/getting-started/first-layout.md) embedding happens using native WordPress shortcodes. Each *Layout* has its own unique shortcode that can be pasted into any location, regardless of the theme, editor, or page builder you're using.&#x20;

Shortcodes also support arguments, allowing you to customize the behavior of the same entity in different contexts.

## 1. How to display fields of the current User

{% hint style="info" %}
The current user is a logged-in user viewing the page, not the static user who created the *Layout.*
{% endhint %}

You can display **native User profile fields** (like name, email) **of the current user** inside any *Layout*.&#x20;

1. [Create a new Layout](/advanced-views/getting-started/first-layout.md) (or open any existing)
2. Add any fields from the User (WordPress) group
3. Save the *Layout*, copy its [embedding shortcode](/advanced-views/layouts/embedding-shortcode.md)
4. Embed *Layout*: paste the shortcode inside the target place

That's it.&#x20;

{% hint style="warning" %}
This method works only with the **native fields** of the **current user**.\
To display custom fields or the native fields of a specific user, follow the instructions below.
{% endhint %}

## 2. How to display any User profile fields

The steps below are applicable for both custom user fields (that you added yourself) and native WP User fields (like name).

1. [Create a new *Layout*](/advanced-views/getting-started/first-layout.md)
2. Add any User fields
3. Save the *Layout*, copy its [embedding shortcode](/advanced-views/layouts/embedding-shortcode.md)
4. Add the `object-id="user"` argument
5. Optionally. Add the `user-id="YOUR_ID"`  if you need to display fields of a particular user. Omit to display the fields of the logged-in user viewing the page (not the static user who created the *Layout*)
6. Embed *Layout*: paste the shortcode inside the target place

#### &#x20;Shortcode format

To load fields from the user profile, the *Layout* shortcode should contain at least 3 arguments:

```bbcode
[avf-layout name="Name" id="651d5d75bfdf2" object-id="user" user-id="OPTIONAL_USER_ID"]
```

1. `name` argument - used for clarification purposes only and doesn't play any functional role.&#x20;
2. `id` argument - associates the shortcode with a specific *Layout*.
3. `object-id` argument - with `user` value&#x20;
4. `user-id`  optional argument - specifies the user ID whose fields should be displayed. If the argument is omitted, the *Layout* **dynamically** displays the fields of the logged-in user viewing the page (not the static user who created the *Layout*)

{% hint style="success" %}
You can also use the common [*Layout* shortcode arguments](/advanced-views/layouts/embedding-shortcode.md) to additionally customize this *Layout* embedding, e.g., limiting its visibility for specific user roles.
{% endhint %}

## 3. How to display a User field type

For displaying fields of the specific user chosen in the User field, please refer to this [User field guide](/advanced-views/field-types/relational/user-field.md).
