So I am using a custom post type to create a listing of businesses. Each post made, contains information about each business. The title of each post is the name of the business.

When I go to the menu created by the custom post type, I receive a standard listing of posts. (or in this particular case, a listing of business names). The posts show in a random order (or possibly being sorted by date on default?)

How can I allow for my posts to be listed in alphabetical ascending order by default?

1 Answer 1


You should use pre_get_posts:

function wpse56753_businesses_default_order( $query ){
    if( 'business' == $query->get('post_type') ){
        if( $query->get('orderby') == '' )

        if( $query->get('order') == '' )
  • 2
    @MichaelEcklund It's Stephen, what do you expect? :-)
    – its_me
    Jun 28, 2012 at 2:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.