Advanced Views Docs
Live PlaygroundDownload PluginGet PRO
  • 💡Help Centre
  • ⚡Getting Started
    • Introduction
      • Key Aspects
      • Creating Your First View
      • Creating Your First Card
      • Plugin Terms
      • Plugin Interface
        • Field Options
    • Installation
      • Advanced Views Lite
      • Advanced Views Pro
      • Comparison Table
      • Upgrading from Lite to Pro
    • Supported data vendors
    • Starter theme
  • 🌟Display Content
    • WordPress
      • Post
      • Taxonomy terms
      • User
      • Comments
      • Menus
    • WooCommerce Product
    • Meta fields
      • Basic fields
        • Number
      • Content fields
        • Image
        • File
        • WYSIWYG
        • oEmbed
        • Gallery
      • Choice fields
        • Select/checkbox/radio
        • True / False
      • Relationship fields
        • Link
        • Post_object
        • Page Link
        • Relationship
        • Taxonomy
        • User
      • Advanced fields
        • Google Map
        • Google Map Multiple Markers
        • ACF OpenStreetMap Field
        • Date/time picker
      • Layout fields
        • Group (Pro)
        • Repeater (Pro)
        • Flexible (Pro)
    • Object fields
    • Custom Data (Pro)
    • Custom Gutenberg Blocks (Pro)
    • Mount Points (Pro)
    • Front-end assets management (Pro)
  • 🦸‍♂️Query Content
    • Basic Filters
    • Meta Filters (Pro)
      • Current Post
      • Comparison
      • Dynamic Injection
    • Taxonomy Filters (Pro)
    • Pagination (Pro)
    • Custom Data (Pro)
  • 🏆Shortcode Attributes
    • Common Arguments
    • View Shortcode
    • Card Shortcode
  • 🧙‍♂️Templates
    • Customizing the Template
    • Template engines
      • Twig
      • Blade
    • CSS & JS
      • BEM Methodology
      • WordPress Interactivity API
    • File system storage
    • Pre-built components
    • Reusable components library (Pro)
    • Live reload
    • Multilingual
    • Custom Ajax & Rest API (Pro)
  • ☕Guides
    • Display Custom Post Type (CPT) on another post
    • Display Employees (CPT) of a Company (CPT)
    • Display Nested Repeater Fields
    • Map Marker from ACF Image
    • Display all CPT items on a single map
  • 🛠️Tools
    • Export/Import
    • Demo Import
    • Settings
    • Preview
  • 🏹Troubleshooting
    • Compatibility
    • Report a bug
    • Payment Issues
    • Lite Support (Forum)
    • Pro Support
  • ⚙️Customization
    • Filters and Hooks
      • View
      • Card
    • Suggest a feature
    • Performance
Powered by GitBook
On this page
  • 1. How to use it
  • 2. Displaying user details (Pro)
  • As a list
  • As a grid
  • 3. Displaying user's slider (Pro)
  • 4. Displaying posts of the chosen user (Pro)
  • 5. See it in action

Was this helpful?

  1. Display Content
  2. Meta fields
  3. Relationship fields

User

PreviousTaxonomyNextAdvanced fields

Last updated 1 month ago

Was this helpful?

This User field type (e.g. ) is useful for creating relationships between data objects. It stores its value as the WordPress user ID.

1. How to use it

Select the user field from your field Group.

2. Displaying user details (Pro)

To display user details, follow these steps:

  1. Use Advanced Views Pro: AVF Pro allows you to customize the appearance of object fields.

  2. Create the Primary View: Start by creating the main View, which will act as the master View. Choose the target user field as save the View.

  3. Create a ‘User Details’ View:

    This View will be responsible for displaying user details.

    In the Fields tab, select the user fields you want to display, such as the display name, bio, website, and avatar (an ACF Image field).

  4. Save the 'User Details' View: After setting up the fields, save the 'User Details' View.

  5. Link the Views:

    Go back to the primary (master) View.

    In the User field settings, select the 'User Details' View in the 'View' setting.

  6. Save the Master View: Save the master View to complete the setup.

  7. Customize as Needed: Now, each chosen user in the User field will be displayed according to the 'User Details' View. You can further customize the markup and add CSS styles as needed.

That's it! By following these steps, you can display detailed user information and have full control over the layout and styling.

As a list

#view__users {
display: flex;
gap: 10px;
}

As a grid

#view__users {
 display: grid;
 grid-template-columns: 1fr;
 gap: 20px;
 }

@media screen and (min-width:992px) {
 #view__users {
  grid-template-columns: repeat(4, 1fr);
 }
}

3. Displaying user's slider (Pro)

After adding the User field to the target View, change the 'Enable Slider' option to 'Splide v4' and press the Save button. It'll automatically change the field markup to incorporate the necessary classes, and add the default JS instance:

var users_field = this.querySelector('.acf-view__users');
if (users_field) {
	/* https://splidejs.com/guides/options/ */
	new Splide(users_field, {
		type: 'loop',
		perPage: 1,
		perMove: 1,
	}).mount();
}

4. Displaying posts of the chosen user (Pro)

In addition to displaying user details, it can be valuable to query and display all posts or products related to a specific user. For example, let's say you have WooCommerce Products and an ACF User field called "Vendor" assigned to them. On a single product page, you might want to display all products linked to the same user.

5. See it in action

Displaying a simple user link is minimalist, but in many cases, you may want to show more details about the selected user(s). For example, besides the user’s name, you might also want to display their bio, website, and avatar, with the avatar being an ACF attached to the user.

To display all the items in a single row, you can use the CSS :

To display all the items as a grid, you can use the :

Advanced Views comes with a , so you can easily turn the user items into a slider. Before activating the slider feature, read the 'displaying user details' section to learn how to setup the details look for each item.

You can customize it according to your needs, using any available .

To achieve this, you should create a Card with a and use to retrieve the field value dynamically. This approach allows the Card to query all products made by the user chosen in the current product's field.

and Navigate to Display Meta fields > Relationship fields.

🌟
Image field
Flexbox
CSS Grid
set of pre-configured JS libraries
Splide options
Meta Filters
dynamic injection
Visit the Playground
ACF User field
Users are displayed with their details.