• mdogan

    (@mdogan)


    Hi

    I would like to listing orderby “surname” all staff list on the staff page. But I can listing just firstname.

    Could you please help me for this issue.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • zalkanov

    (@zalkanov)

    Hello mdogan,

    The “orderby=name” parameter of the [staff-directory] function, returns a result based on the “post_name” which you can find in the wordpress db under “wp-posts”, and not the name you define as the name while filling the post.
    If you want to use “orderby=name” and have it order your staff members by surname instead of their given name, you’ll have to edit the post_name column in your database to the staff’s surname.

    The orderby parameter is kind of sketchy and could definetly use some polishing as it only has the option of using ID (returning the post’s id from the database; displaying the staff members in the order they were created in) and name (returning the post’s name from the database; displaying the staff members in the alphabetical order of the first title given to the post).

    When you’ll be adding new staff member’s you’ll have to make sure to use their surname as the post’s title to prevent the ordering being akward and having to edit the database again.

    I hope this helped you

    Thread Starter mdogan

    (@mdogan)

    Hi Zalkanov,

    Thank you for your replay. I found a basicly solution for this problem. firstly I listed by the surname on the excel. I wrote the parameter one under the other at below and problem is fixed at the present.

    [staff-directory id=6635order=asc template=custom_2]
    [staff-directory id=6645order=asc template=custom_2]
    [staff-directory id=5435order=asc template=custom_2]
    …..

    Thanks.
    MD

    • This reply was modified 8 years ago by mdogan.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Orderby Surname ?’ is closed to new replies.