I want to display total no of users.
I have a custom post type – ‘student’
I created a checkbox custom field – student_subject inside this CPT.
The checkbox custom field ‘student_subject’ have following values
Maths
Science
Commerce
English
I want to display total number of students which are checked as Maths.
Kindly guide me.
You have 2 choices
1) you can do a query for all of the posts in the CPT, loop through them and count the check boxes
2) You can do an individual query for each of the 4 values. See the section titled 3. Multiple custom field values (array based values) on this page https://www.advancedcustomfields.com/resources/query-posts-custom-fields/. (Checkboxes are stored as arrays.)
Thank You. It is Working Now.