WordPress.org

Ready to get started?Download WordPress

Forums

Sort posts alphabetically by custom field (3 posts)

  1. Ryan Paul
    Member
    Posted 5 years ago #

    I'm creating a listing of people using custom fields to enter first name and last name...

    I want to display a list of those posts displaying the 'Last Name' custom fields first alphabetically.. i.e;

    • Ally, Oop
    • Smith, Jones
    • Tegan, Bob
    • Uncle, The Man From

    Someone help me pleeeease? I'm about ready to scratch grooves in my face and stab my monitor with a fork.

  2. iridiax
    Member
    Posted 5 years ago #

    See:

    http://codex.wordpress.org/Displaying_Posts_Using_a_Custom_Select_Query

    Use this to sort instead:

    ORDER BY $wpdb->postmeta.meta_value ASC

  3. iridiax
    Member
    Posted 5 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic