<?php $page="110"; //the homepage ?>
<!-- ############################################# //-->
<!-- ################## VENDOR LOGOS ############# //-->
<!-- ############################################# //-->

<?php 
// Get the Reviews
function makeArrayWithLogos($termID) {
	$args = array ( 
		'post_type'			=> 'vendors', 				// Name of post type.
		'posts_per_page'	=> -1,
		'order'				=> 'DESC',
		'tax_query' => array(
			array (
				'taxonomy' => 'vendor_logos_type',		// Taxonomy name
				'field' => 'tag_ID',					// Term_id, slug or name, or tag_ID
				'terms' => $termID,						// Term id value, term slug or term name value, or tag_ID value
			) 
		)
	);

	$theVendor = new WP_Query( $args );
	return $theVendor;
}
?>
<div class="container site-black overflow-hidden">
	<div style="background-color: #0099db;">
		<div class="text-center">
			<h3 class="font-50 brk-600-font-25 brk-900-font-45 site-white"><?php the_field('vendor__logo_intro_sentence','CPT_vendors'); ?></h3>
		</div>
	</div>
		<?php $vendors = makeArrayWithLogos('28'); //28 is General Cat 
			$rows == 0;

			// Create the break points to create a new row
			$breakArray = array(0, 4, 8, 12, 16, 20, 24);
			
			while ($vendors->have_posts()) : $vendors->the_post(); 

			if (in_array($rows, $breakArray)) {	
				echo '<div class="flex row justify-center brk-600-col w-90-p brk-1200-w-90-p brk-900-w-initial mg-auto">';
			}

			$rows++;
		?>
			<div class="flex col justify-start w-20-p brk-600-w-initial text-center">
				<a href="<?php the_field('vendor_link'); ?>" target="_blank"><img src="<?php the_field('logo_image'); ?>" style="max-width: 230px;" /></a></li>
			</div>	
		<?php	
			if (in_array($rows, $breakArray)) {		
				echo '</div>';
			}	
		
			endwhile; ?>
	</div>		
</div>