Group Posts by multiple custom fields
-
Hello everyone,
I’ve been trying to achieve something for a few days but have so far been unsucessfull.
I have a setup where i have a set of posts with multiple custom fields, and what it would like to do is to display all of those posts, but grouped by one custom field, and then by another custom field.
As an example, posts have field#1 that can have up to 20 different values, and i want to group the post by that value first.
Then, there is field#2 wich has 2 values (“on” or “off”).
I’d then like to group the posts depending on if they have the “on” or “off” value, so it would look a little bit like this:—————-field#1 – Value 1——————
–field#2 – value on——|—–field#2 – value off—-
–field#2 – value on——|—–field#2 – value off—-
–field#2 – value on——|—–field#2 – value off—-
—————-field#1 – Value 2——————
–field#2 – value on——|—–field#2 – value off—-
–field#2 – value on——|—–field#2 – value off—-
–field#2 – value on——|—–field#2 – value off—-Hope this can help in examplifying what i’m trying to do.
If someone can point me in the right direction it would be extremely helpful!
- The topic ‘Group Posts by multiple custom fields’ is closed to new replies.