I am relatively new to WordPress and am confused by the error I am getting with the attached code. It runs okay returning the count but throws the above warning. It does not throw the error on my localhost and I have similar loops running on the same page with no warning:
<?php
$typecount = 0;
$deal_name = "Wing Night";
$args = array( 'post_type' => 'dealdetails', 'posts_per_page' => -1 );
query_posts( $args );
while ( have_posts() ) : the_post();
?>
<?php
$deal_type = get_field('deal_type');
foreach($deal_type as $x => $x_value){
if($x_value == $deal_name){
$typecount++;
}
}
?>
<?php
endwhile;
echo '(' . $typecount. ')';
?>