This tutorial explains how to display custom user fields using. We show how to use Types API with PHP and Views, without coding.
Displaying User Fields With Views
When you create Views or Content Templates, you can insert your user fields directly using the Types button (or Fields and View button if you also have activated Views plugin) of editors. You will see all your extended user fields.
Then, if you select a user field, you will see a standard Types dialog box, where you can set the shortcode options.
You can display the selected field for:
- The author of the current post or page
- The current logged in user
- A specific user – by user ID or by user name.
Displaying User Fields With Types API
Using Views, it’s easy to create templates that include user information. Select the fields, set their display attribute, who they belong to and insert.
Types stores user fields in the standard usermeta table. You can display them with the low-level WordPress API, but using the Types API is recommended. With Types API, your fields will render with their correct formatting.
To learn more about displaying user fields with PHP and Types API visit the page about creating custom user profiles.