Forums

sort posts by title, ignore articles like “the”, “a”, “an” (3 posts)

  1. blehn
    Member
    Posted 5 months ago #

    I'm sorting my posts alphabetically by Title, like so:

    $posts = query_posts($query_string .
    '&orderby=title&order=asc&posts_per_page=-1');

    I'd like to exclude articles such as "the", "a", and "an" from the sorting criteria.

    Is there a way to do that?

    Thanks!

  2. SwansonPhotos
    Member
    Posted 5 months ago #

    I would suggest a combination of PHP conditional statements and filters.

  3. blehn
    Member
    Posted 5 months ago #

    Thanks, but could you be more specific?

    The closest I could figure out would be using raw SQL (http://www.arraystudio.com/as-workshop/how-to-sort-mysql-results-ignoring-definite-and-indefinite-articles-the-a-an.html), but I'm not sure how I'd do that in conjunction with the wordpress API.

Reply

You must log in to post.

About this Topic