Hello!
So, I have found bunch of topics about wrapping every nth-item in div, but there is not topic about wrapping first five items in one separate wrapper and all other remaining rows into another wrapper. How to achieve that?
You can use an if statement as follows:
<?php
$i = 0;
if(have_rows(‘repeater_name){
while(have_rows(‘repeater_name’)){
the_row();
$i++;
if($i=1){
<div>
}
// output your normal data between here
if($i<=5){
</div>
}
}
}
?>
No, sorry, this only wraps every item in div. I need it to count out first 5 rows, wrap them in div and count out another remaining rows and wrap them in another div.
Oops my bad, I was counting every element up to 5
http://debunc.com/maidus-repeater-test/
This works using the following code:
http://pastebin.com/EyZtLbjx