Problem: I would like to show a View of posts and calculate the total number of posts with each custom field value, like the results of a survey.
Solution: There's nothing built-in to Views that will calculate the total number of posts with a specific custom field value on-the-fly, so the display you described must be built out piece by piece using Views and Views shortcodes. You could use multiple filtered Views to achieve something similar. For example:
- View of submissions filtered by custom field "Question 1", answer "Yes"
- Use the wpv-found-count shortcode to output the number of submissions.
- View of submissions filtered by custom field "Question 1", answer "No"
- Use the wpv-found-count shortcode to output the number of submissions.
- View of submissions filtered by custom field "Question 1", answer "I don't know"
- Use the wpv-found-count shortcode to output the number of submissions.
- A second View of submissions filtered by custom field "Question 1", answer "No"
- In the loop output editor, display the "reason" free-response field
...and so on for each question.
Related documentation:
https://toolset.com/documentation/user-guides/views-shortcodes/#vf-155378
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - | - |
13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - | - |
Supporter timezone: America/New_York (GMT-04:00)
This topic contains 3 replies, has 2 voices.
Last updated by 5 years, 5 months ago.
Assisted by: Christian Cox.