How to group by custom field
-
Hi!
I have a type of post called ‘projects’ and this post have a field custom field called ‘year’.I would like to show this post group by year kind of this
- 1991
- project 1
- project2
- 1995
- project2.1
- project 2.2
- 1996
- project A2.1
- project A2.11
- 1997
- project AA
I have made this query
<?$wp_query->query('post_type=project_post&posts_per_page=-1&orderby=year&order=ASC');?>
But like this i get the year on every project..kind of this
- 1991 project 1
- 1991 project2
- 1995 project2.1
- 1995 project 2.2
- 1996 project A2.1
- 1997 project AA
Thanks!
.and that’s not what I’m spected.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘How to group by custom field’ is closed to new replies.