Query using custom field to sort alphabetically
-
I’m sorting my posts in the category list alphabetically using
<?php $posts = query_posts($query_string . '&orderby=title&order=asc'); ?>My post titles are names, so it obviously sorts using the first name. I’d like to sort using the last name and have created a custom field called “sortname” with the last name first. What does the query above need to be to sort using the custom field rather than the title?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Query using custom field to sort alphabetically’ is closed to new replies.