Support

Account

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