Вывожу контент в шаблон сайта в количестве 10 новостей. В шаблоне контент делится на блоки, код:
<div class="col-md-4">
<article class="card mb-4">
<header class="card-header">
<div class="card-meta">
<a href="#"><time class="timeago" datetime="2019-07-16 20:00">16 july 2019</time></a> in <a href="page-category.html">Work</a>
</div>
<a href="post-image.html">
<h4 class="card-title">How can we, how can we sing about ourselves?</h4>
</a>
</header>
<a href="post-image.html">
<img class="card-img" src="img/articles/3.jpg" alt="" />
</a>
<div class="card-body">
<p class="card-text">Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. </p>
</div>
</article><!-- /.card -->
<article class="card mb-4">
<header class="card-header">
<div class="card-meta">
<a href="#"><time class="timeago" datetime="2019-10-15 20:00">15 october 2019</time></a> in <a href="page-category.html">Lifestyle</a>
</div>
<a href="post-image.html">
<h4 class="card-title">The king is made of paper</h4>
</a>
</header>
<a href="post-image.html">
<img class="card-img" src="img/articles/20.jpg" alt="" />
</a>
<div class="card-body">
<p class="card-text">Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. </p>
</div>
</article><!-- /.card -->
</div>
Как в
<div class="col-md-4">
вывести по два
<article class="card mb-4">
Вывожу так:
$c = 1;
foreach($obj['itemListData'] as $key=>$val){
$id = $val['itemInfos']['id'];
$text = $val['itemInfos']['text'];
.. . шаблон ...
if ($c == 10) break;
$c++;
}
Запутался :( Помогите, пожалуйста.