Home › Forums › General Issues › Show number of objects in each query › Reply To: Show number of objects in each query
Hi @mindgames
Your first query will find all mobiles, correct?
If you want to list the total mobiles in each category, you can simply loop over your results and load the mobile category.
Then use this category to increase a counter like so:
$counter = array(
'android' => 0
);
// start loop over posts
$category = 'xxx';
$counter[ $category ]++;
// end loop over posts
//output
echo 'android total = ' . $counter['android'];
Hope that helps.
Thanks
E
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.