Hi Michael,
Thank you for contacting us and I'd be happy to assist.
To achieve this, you'll need two separate views:
1. First, you'll create a user view, which will give you the list of all the users of your desired role.
In the "Content Selection" setting of this view, you'll select "Any role", as you'll be filtering the role through the "wpv_filter_user_query" hook:
( ref: https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_user_query )
add_filter( 'wpv_filter_user_query', 'filter_products_view_test', 1000 , 3 );
function filter_products_view_test( $query_args, $view_settings ) {
// check if it is the target view
if ( !is_admin() && ( isset($view_settings['view_id']) && $view_settings['view_id'] == 12) ) {
// get the value of the role passed through the shortcode attribute
global $WP_Views;
$attributes = $WP_Views->view_shortcode_attributes;
// if no role is set from the view's settings and role value is passed through the shortcode attribute
if( (empty($query_args['role__in'])) && (!empty($attributes[0]['role'])) ) {
// set query to only include users from the role passed through the shortcode attribute
$query_args['role__in'][0] = $attributes[0]['role'];
}
}
return $query_args;
}
The above code snippet can be included through either Toolset's custom code feature ( ref: https://toolset.com/documentation/adding-custom-code/using-toolset-to-add-custom-code/ ) or through active theme's "functions.php" file.
It will get the role's slug from the view's shortcode attribute and will filter the view's list to only return users with that role.
Example usage of the view's shortcode, assuming the slug of this new view is "user-view-slug":
(you'll need to change this slug with the one used on your website)
To get only the list of users with the "administrator" role:
[wpv-view name="user-view-slug" role="administrator"]
To get only the list of users with the "editor" role:
[wpv-view name="user-view-slug" role="editor"]
And so on.
2. The second view will be a post view, that will show the actual resume posts.
In the "Query Filter" section you'll include a post author filter with "Post author is set by the parent User View" option.
Example screenshot: hidden link
As a result, when you'll nest this post view inside the loop of the parent user view, you'll get all the posts from each user of the target role.
I hope this helps and let me know if any step is not clear.
Note: The code snippet included in this reply is shared as an example and for more personalized assistance around custom code, you can consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/
regards,
Waqar