MB group loop - users

Support MB Elementor Integrator MB group loop - users

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #39049
    YasmineYasmine
    Participant

    Hey, is there any way the MB group loop can work to list users too? (not posts). Is there a way to add own query?

    Many thanks,
    Yasmine

    #39069
    PeterPeter
    Moderator

    Hello Yasmine,

    If you want to display a list of users on the frontend with Elementor page builder, you can create a field user for a post and select some users. It works like other select fields post and taxonomy.

    If you want to display a list of users by coding, please use the WordPress function get_users().

    #39074
    YasmineYasmine
    Participant

    Oh thats a clever idea. I have been able to output when users are attached to a post before. To give context on what I am trying to do: I am trying to show members of my team and the community. Before, I used a CPT to show team members and wider community, but was too much admin. So I wanted to dynamically populate and keep updated. Can I add a get_users($args) as the posts value with this method?

    I tried with the get_users, was fine for text but I struggled with their image. I use a custom field for my avatar, and so when I tried get_avatar_url() / get_avatar(), it returned the default avatar and not the users avatar. And when I tried $image =rwmb_meta( 'custom_avatar', ['size' => 'thumbnail'], $user_id); src=$image it returned nothing.

    So still unsure which direction to go. If I can fix the second issue, then I think it might make more sense for my usecase.

    Many thanks,
    Yasmine

    #39097
    PeterPeter
    Moderator

    If you want to get the post meta, you need to use the function get_posts().

    Regarding the custom avatar field, can you please let me know how did you register the custom field and the code that output the field value?

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.