[s2Member-List] shortcode - search parameter causing other parameters to be ignored

I’m setting up a user directory for my level 4 members which I’ve called staff - hence it will be a staff directory as such. I’ve mostly been okay with customizing this so far, but am running into a little bit of wall.

In cases where I’m using “search”, other parameters seem to get ignored.

Example 1: In this example, in one area I’ve used the shortcode twice in an attempt to list two specific users at the top via the “include” parameter, which works fine. In the second instance, I listed those same two users as part of the “exclude” parameter, and set the search to “SMM”, which is a custom profile registration field I set up. However, the exclude parameter in the second instance gets ignored, so those two users end up getting listed twice since they also belong to the SMM custom profile registration field.

[s2Member-List levels=“4” orderby=“last_name” order=“ASC” template=“themes/alpha/modules/my_members.php” avatar_size=“90” show_fields=“Title:gs_title_eng, Dept:gs_department” include=“859,1077” /]

[s2Member-List levels=“4” orderby=“last_name” order=“ASC” template=“themes/alpha/modules/my_members.php” avatar_size=“90” show_fields=“Title:gs_title_eng, Dept:gs_department” exclude=“859,1077” search=“SMM” /]

Example 2: A little bit simpler of an example.

[s2Member-List levels=“4” orderby=“last_name” order=“ASC” template=“themes/alpha/modules/my_members.php” avatar_size=“90” show_fields=“Title:gs_title_eng, Dept:gs_department” search=“COMM” /]

Having set the Search parameter to COMM (another custom profile reg field), the “order” parameters are ignored. The results returned are not in ascending order by last_name, as specified in the query.

Any advice would be appreciated.

Does this thread help? How to use checkbox to agree to be included in Membership List

Sadly not. The searching aspect works, but in doing so, the other parameters (like sorting, and sort_order, etc) are ignored. I included some of the other parameters that Jason uses in his example from that thread, e.g.

[s2Member-List levels=“4” orderby=“last_name” order=“ASC” template=“themes/alpha/modules/my_members.php” avatar_size=“90” show_fields=“Title:gs_title_eng, Dept:gs_department” search_columns=“s2member_custom_field_gs_department” search=“COMM” enable_list_search=“yes”/]

…but with the same end result.

Interestingly, I’ve played with this more, and got my second example working as expected by removing the orderby=“last_name” parameter, as follows:

[s2Member-List enable_list_search=“yes” search_columns=“s2member_custom_field_gs_department” levels=“4” avatar_size=“90” search=“COMM” show_fields=“Title:gs_title_eng, Dept:gs_department” template=“themes/alpha/modules/my_members.php” order=“ASC”/]

This happens to sort it correctly by last_name anyway, and the order=“ASC” parameter is not ignored.

So I’m almost there.

I still can’t manage to get the “exclude” parameter working in conjunction with the “search” parameter. :-/

trev800… did you ever resolve this? I’m having a similar problem where orderby=“last_name” works fine when the search field is empty but it sorts by display_name when an actual search is done. When I remove orderby=“last_name”, as you suggest above, I think it sorts by the WordPress user ID. I posted to the forum but haven’t heard anything from anyone yet.