Member directory: sorting uses without profile image last
-
hi all,
how to sort the member directory depending on the profile image. the users without a profile image should be the last in the sorting.I tried some code see below, but I was not successful.
function hide_users_without_photo_($query) {
// Check if it’s the Ultimate Member query
if (isset($query->query_vars[‘um_user_query’]) && $query->query_vars[‘um_user_query’]) {
// Modify the query to exclude users without a profile photo
$query->query_where .= ” AND ID IN (SELECT user_id FROM wp_usermeta WHERE meta_key = ‘profile_photo’ AND meta_value != ”)”;
}
}add_action(‘pre_user_query’, ‘hide_users_without_photo_’);
https://www.itf-guides.at/mitglieder/?filter_languages_77509=Englisch
The page I need help with: [log in to see the link]
- The topic ‘Member directory: sorting uses without profile image last’ is closed to new replies.