Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Ordering posts by surname, WP

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #29645
    keithdevon
    Member

    Hi all,

    I recently built the site for the Royal Ulster Academy. They have one criticism and that is that on the members page, the artists are ordered by their first names and not their surnames.

    The site uses WordPress and I know how to change the order between chronological, random, title, etc but not how to specify alphabetical using the title’s last word. Does anyone know how to achieve this? I’m sure a lot of people would find it useful.

    The only other options that I can think of is to use custom fields or change the title format to ‘Smith, John’.

    Thanks for your help,

    Keith

    #79878
    TheDoc
    Member
    "keithdevon" wrote:
    The only other options that I can think of is to use custom fields or change the title format to ‘Smith, John’.

    That’s exactly what I was going to suggest. If you don’t put the last name first, people won’t see that things are ordered alphabetically anyways.

    #80379
    keithdevon
    Member

    I came up with a bit of an ugly fix.

    I used a custom field named ‘surname’ and ordered the posts using this field. The code used is:

    Code:
    ‘orderby’ => ‘meta_value’,
    ‘meta_key’ => ’surname’,

    There’s more info on my blog post: http://keithdevon.com/articles/sorting- … -surnames/.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Back End’ is closed to new topics and replies.