If I were writing a sql query for this it would be:
SELECT state, count(*)
FROM events
WHERE state is not null
GROUP BY state
and I'd want this result:
STATE COUNT
Maryland 5
Virginia 11
Utah 3
I tried to use [wpv-items-count] but I get duplicate states and counts so it's not grouping by state.
Hello,
I assume we are talking about this case:
1) A custom post type "Event"
2) A custom taxonomy "State", rigistered to above post type.
If it is, you can try to setup a nested view.
For example:
1) Parent taxonomy view:
- query terms of taxonomy "State",
- in view's loop, display below child post view
2) Child post view:
- Query "Event" posts
- Filter by:
Select posts with taxonomy:
State set by the parent Taxonomy View
- outsider view's loop, display shortcode [wpv-found-count]
More help:
https://toolset.com/documentation/user-guides/views/using-a-child-view-in-a-taxonomy-view-layout/
hidden link
Please don’t close this yet. The setting error has not been resolved so I haven’t had a chance to test Luo’s code. Jim
I have marked this thread as waiting for feedback status, so you can update herer when you need more assistance.