Modifying the Wordpress Loop - Please Help!!!

Discussion in 'PHP' started by spycraft, Aug 29, 2011.

  1. #1
    Hello all,

    First of all - I posted this here because it's a PHP related question and one that goes common blogging questions...

    I have two custom fields X and Y for each of the posts in question. I would like to get the loop to output the posts sorted first by the value on X and then by the value of Y.

    A more specific example in action:

    Custom field X has values a, b, and c. Custom field Y has values 3, 2 and 1.

    I want the posts to be displayed in the following order: a3,a2,a1,b3,b2,b1,c3,c2,c1.


    I read through http://codex.wordpress.org/Class_Reference/WP_Query and it does have a section that talks about "Multiple orderby values" but that won't work as far as I can understand since there can only be one meta_value in each array...

    Any ideas?

    Thanks in advance!
     
    spycraft, Aug 29, 2011 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,899
    Likes Received:
    4,555
    Best Answers:
    123
    Trophy Points:
    665
    #2
    sarahk, Aug 31, 2011 IP