Skip Navigation

[Resolved] Split: List profile posts of users with particular role

This support ticket is created 5 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

This topic contains 10 replies, has 2 voices.

Last updated by Nigel 5 years, 2 months ago.

Assisted by: Nigel.

Author
Posts
#1194193

Other questions:
1 - So, in some pages I need to display a list of the Profile post about the users that have a specific Role, or order the Profile posts putting on top of the list the Profile posts about the users that have a specific Role.

#1194468

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Screenshot 2019-02-01 at 15.48.03.png

If I have understood what you need correctly, you need two Views for this.

The outer View is to retrieve Users with the required role. So make a View where the content selection is Users, and check the relevant role.

In the output section of this View you will insert a second View.

This View will query profile posts, and needs a Query Filter for the post author to match the User set by the outer View (see screenshot for example).

Output fields of the profile post as required, then insert this View inside the wpv-loop tags of the outer View.

#1194746

Hi Nigel,
thanks, but, where in the View I can check the relevant role?
And this will display only the post of the relevant role or it display the posts in order about the relevant role first?

#1195402

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Each of your users has a connected member profile post.

The information about a user's role is stored on the user, not on the profile.

You cannot make a View to display profile posts for users with a particular role, because the profile posts don't know what the role is (unless you have set up the profile posts so that they *do* store the role, but I'm guessing not).

In which case you need two Views, a parent View to get the users who have a particular role, which will then iterate over those users, and a nested child View which gets the profile post for the user coming from the parent View.

So my screenshot to select the role is from the first, parent, View, which doesn't show posts, it queries users, and for which you should see the same option to specify the users with which roles to return.

Or have I misunderstood and you want to do something else?

#1197339

Sorry for my delay in reply, but I have little time this period.

I will try the solution this weekend!

#1197346

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

OK

#1198929
VIP items carousel - incontrAmici.png

Hi Nigel,
I have followed your guide, so are displayed only the Profile posts about the Stato Vip Role.
But I don't know why the loop display the results in this mode... I need to display the results in a carousel slider...

#1199111

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

The carousel would need to be created by the outer View (for users), not the inner View (for posts).

It looks like you made a carousel posts View and then inserted it into the outer user View, so you are getting multiple carousels of a single profile post.

Set up the user View so that it outputs as a slider.

Set up the inner profile post View so that it outputs one "slide". It would probably be helpful to check the option "Disable the wrapping DIV around the View" for the inner View so that you get a clean output from that as an input to the outer View.

#1202023

Sorry for my delay, and thanks for your reply Nigel,
I have solved the issue with your last guide.
Thanks!!!

#1202025

So, other question, now with this setup I display only the user Profile that has the "Stato VIP" Role.
In the same carousel I need to display first the Profiles list about the user with "Stato VIP" role and after the Profiles list about the user with "Stato Base" role.
What should I do to have this condition?

New threads created by Nigel and linked to this one are listed below:

https://toolset.com/forums/topic/split-list-profile-posts-of-users-with-particular-role-2/

#1202950

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

I've split the new question into a new thread, and will follow up there.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.