So create a View to display users. Add a Query Filter for the department custom field, and specify that the value should come from a shortcode attribute (give the attribute a name, maybe "department").
Out the user name and whatever else you require from each user.
Then where you want such a list to appear, insert the View as many times as needed, e.g.
Thanx Nigel 🙂
So far so good.
1.
I have made the custom user field 'Department'.
2.
And made the two views. 'Department'-view which is calling the 'Department child'-view with all the details need to show.
But I cannot get my head around the filter part...
There is no query filter option for the 'Department'-field?
Also I guess that it would be the 'user filer'-option I should use?
But who does the interaction work between the two views and who is the query specified to select the value from the custom field?
You should only make one View, not two, and then you can re-use this one View as many times as you need, specifying the department each time you insert the View.
There seems to be a problem, though, in that the user field you created, I don't see it in the dropdown for the Query Filter for the View.
In my screenshot you can see that I created a User Field Group "Profile fields" which has one custom field, "Favourite team".
I can't see a Department field in your screenshot of the same dropdown.
Can you check again?
If you added a User Field Group at Toolset > Custom Fields then you should see the fields from that group listed in the Query Filter dropdown.
Now I got it to work! Thank you for all your help 🙂
It was a mystery why the custom field did not show up. Maybe some sort bug in rare cases made it not work properly?
I delete it and made a new one with the same name and that showed up...
Limited the view down to one and inserted the shortcode attribute department="".
Like this:
<h2>REDAKTION CAP&DESIGN</h2>
[wpv-view name="departments-contact-page" department="1"]