• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Custom loop sort order – alphabetical

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Custom loop sort order – alphabetical

This topic is: not resolved

Tagged: alphabetical, custom post type archive, directory, query_posts

  • This topic has 1 reply, 2 voices, and was last updated 11 years, 5 months ago by Ren Ventura.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • January 2, 2015 at 11:13 am #135863
    Au Coeur
    Member

    On http://mobanetwork.org/directory/ I have a directory (custom post type archive) that is running a custom query which is supposed to sort alphabetically by post title but only sort of does it (some listings are out of place) and I cannot figure out why. This is the query I am using:

    query_posts( $query_string . '&posts_per_page=-1' . '&orderby=title' . '&order=ASC' ); ?>

    If I change it to DSC, it will reverse itself, but those few posts are still out of order. If I sort the post list by title in the back end, they sort appropriately so I don't think it is something in the title of the posts. Any ideas why it would be doing this?


    Mother. Web & Graphic Designer. Lactation Consultant. Blogging about how it all fits together, most recently from northern Colorado. Visit my blog or my design site.

    http://mobanetwork.org/directory/
    January 2, 2015 at 1:37 pm #135869
    Ren Ventura
    Member

    You should be using WP_Query instead of query_posts because query_posts is inefficient and buggy.

    http://codex.wordpress.org/Class_Reference/WP_Query


    Web & Software Developer & Blogger | RenVentura.com | Follow Me on Twitter @CLE_Ren

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble