WordPress.org

Ready to get started?Download WordPress

Forums

Alphabetizing Posts (4 posts)

  1. pablogt
    Member
    Posted 4 years ago #

    Is it possible Alphabetizing Posts by last name (Joe-first, Doe-last) in this case showing Joe Doe as is but organizing it by second entry in the post title(Doe-last)

    Usisng the code found in Alphabetizing Posts http://codex.wordpress.org/Alphabetizing_Posts is it possible to ad variants to render it properly organized by last name?

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    If these are post titles, then not easily, no. The post title is stored as a single string, so, when sorted alphabetically, "Albert Smith" would be placed before "Bert Jones".

  3. pablogt
    Member
    Posted 4 years ago #

    Hi esmi, can we use a variant so Jones is reconized as before Smith?

  4. MichaelH
    Member
    Posted 4 years ago #

    Not really without some coding. You'd have to put all your posts titles in a array and when putting them in the array, reformulate the title based on YOUR name requirement, then sort the array, then use that to display your posts.

    You might consider creating a Custom Field and put Jones, Bert in the custom field, then use the orderby=meta_value & meta_key=your name field arguments to do the query_posts().

Topic Closed

This topic has been closed to new replies.

About this Topic