• When I try to sort a list of users by last name, My name “Rxxxx Walker” (user id 103) shows up before my colleague “Mxxxx Walker” (user id 21).

    Here’s the shortcode I’m using:

    [authoravatars whitelistusers=1,7,51,21,103 user_link=authorpage display=show_name,show_biography order=last_name,asc avatar_size=175]

    When there are multiple users with the same last name, they should be sorted within last name by first name. Is there any way for these names to sort correctly?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Paul Bearne

    (@pbearne)

    I assume you tried

    [authoravatars whitelistusers=1,7,51,21,103 user_link=authorpage display=show_name,show_biography order=”last_name,first_name” asc avatar_size=175]

    I will need to look at the code to see if this works or not

    Paul

    Thread Starter Randy Walker

    (@randy)

    Hi Paul,

    I just tried that and it did not work. Is it possible to manually specify the order? That’d be fine too.

    Plugin Author Paul Bearne

    (@pbearne)

    I have made an update for you to try

    https://github.com/pbearne/wp-author-avatars/archive/master.zip

    I added an option to the sorts last_first_name what this does is it does 2 sorts first by the first name and then my last name so if I have got the logic right that should do what you need

    Please test

    Paul

    Thread Starter Randy Walker

    (@randy)

    Thanks for looking into this! I did this:

    [authoravatars whitelistusers=1,7,51,21,103 user_link=authorpage display=show_name,show_biography order="last_first_name" asc avatar_size=175]

    It still shows me, R, before her, M.

    Your logic described above sounds backwards to me. Sort last name then within last name, sort first name is how I imagine it going but maybe I just misunderstood what you wrote?

    Plugin Author Paul Bearne

    (@pbearne)

    I hadn’t spotted that you are using a whitelist try recording the ids it overrides the sort

    Paul

    Thread Starter Randy Walker

    (@randy)

    I have several dozen users and need to display only these 5, in order. 🙁

    Plugin Author Paul Bearne

    (@pbearne)

    Are you sorted when you changed the whitelistusers order

    [authoravatars whitelistusers=1,103,21,7,51 user_link=authorpage display=show_name,show_biography order=”last_first_name” asc avatar_size=175]

    Thread Starter Randy Walker

    (@randy)

    Changing the order of users in the whitelist does not have affect the output 🙁

    Thread Starter Randy Walker

    (@randy)

    Since it’s just 5 for now, I ended up just putting [show_avatar] on the page 5 times. Not the best solution but it works for now.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Sort by Last Name ignores first name when multiple same last name’ is closed to new replies.