I am working on this project where i need to load the different items in the menu. My idea was to use a foreach loop to go through it, which works i get the items, but i can not figure out how to create the row for every 3 items.
HTML
<div class="row box-2">
<div class="grid_4">
<div class="img"><div class="lazy-img" style="padding-bottom: 76.21621621621622%;"><img data-src="images/page-4_img07.jpg" alt=""></div></div>
<h3>Anteger convallis orci vel mi nelaoreet, at ornare lorem consequat. </h3>
<p>Vestibulum volutpatturpis ut massa commodo, quis aliquam massa facilisis.Integer convavel miberto merlonelaoreet, at ornare lorem consequat.</p>
<a href="#" class="btn">Read more</a>
</div>
<div class="grid_4">
<div class="img"><div class="lazy-img" style="padding-bottom: 76.21621621621622%;"><img data-src="images/page-4_img08.jpg" alt=""></div></div>
<h3>Genteger convallis orci vel mi nelaoreet, at ornare lorem consequat.</h3>
<p>Meestibulum volutpatturpis ut massa commodo, quis aliquam massa facilisis.Integer convavel miberto merlonelaoreet, at ornare lorem consequatre. </p>
<a href="#" class="btn">Read more</a>
</div>
<div class="grid_4">
<div class="img"><div class="lazy-img" style="padding-bottom: 76.21621621621622%;"><img data-src="images/page-4_img09.jpg" alt=""></div></div>
<h3>Ternteger convallis orci vel mi nelaoreet, at ornare lorem consequat. </h3>
<p>Testibulum volutpatturpis ut massa commodo, quis aliquam massa facilisis.Integer convavel miberto merlonelaoreet, at ornare lorem consequ.</p>
<a href="#" class="btn">Read more</a>
</div>
</div>
PHP
<?php
foreach ($menuItems as $dish => $item) {
?>
<div class="grid_4">
<div class="img"><div class="lazy-img" style="padding-bottom: 76.21621621621622%;"><img data-src="images/<?php echo $item[img];?>.jpg" alt="<?php echo $item[name]; ?>"></div></div>
<h3><?php echo $item[title]; ?></h3>
<a href="dish.php?item=<?php echo $dish; ?>" class="btn">Read more about <?php echo $item[title]; ?></a>
</div>
<?php
} ?>