Jump to content

remove

Members
  • Posts

    62
  • Joined

  • Last visited

Community Answers

  1. remove's post in Create portfolio cols in Bootstrap was marked as the answer   
    It works!
    Here is the code for anyone who's working with Bootstrap and run into same problem. If you have a 4 cols lay-out change 
    col-md-4 into col-md-3
    and 
    $i % 3 to $i % 4 
    <div class="container"> <?php $items = $page->children; // set the counter to 1 $i = 1; echo '<div class="row">'; foreach ($items as $item) { echo "<div class='col-md-4'> <a href='{$item->url}'><img src='{$item->werk_afbeelding->first()->url}' /> <h4>$item->werk_titel</h4> <p>$item->werk_intro</p></a></div>"; // After 3 close the row div and open a new one if($i % 3 == 0) {echo '</div><div class="row">';} //End count $i++; } ?> </div> </div>
×
×
  • Create New...