• i have a custom query that is showing all 2009 tags sorted by grade.

    <?php $recent = new WP_Query(“tag=2009&showposts=-1&meta_key=grade&orderby=meta_value&order=ASC”);

    i want my letter grades to go in a certain way.
    A+
    A
    A-
    B+
    B
    B-…and so forth till F-

    how would i go about achieving that.

    i looked into a thing called ORDER BY FIELD, where the code is something like this…
    ORDER BY FIELD(grade,’A+’,’A’,’A-‘,’B+’,..rest of values)

    my question is, can someone show me how to use that code in my custom query? i tried dooing it myself but it was sorting wrong.

    any help is appreciated

Viewing 1 replies (of 1 total)
  • Thread Starter stevenybarra

    (@stevenybarra)

    another thing i forgot to post on my original question.

    the way my results are showing is:

    A
    A+
    A-
    B
    B+
    B-…

    thanks again

Viewing 1 replies (of 1 total)
  • The topic ‘sorting by a particular order’ is closed to new replies.