Gracias, lo estoy pensando hace mucho y no se cómo hacer.
Hice algo así
Código PHP:
<?php
$postlist = get_posts( array('posts_per_page'=>20) );
$posts = array();
foreach ( $postlist as $post ) {
$posts[] += $post->ID;
}
$i=0;
$fila=1;
$columna=1;
$saltos=0;
while ($fila != 3) {
if (($columna + types_render_field( "num_cols", array()))<=5){
global $i;
//Setup para mostrar datos de este post
wp_reset_postdata();
setup_postdata( get_post($posts[$i]) );
$i++;
}else{
$num_cols=2;
global $i;
while($num_cols==2){
$i++;
wp_reset_postdata();
setup_postdata( get_post($posts[$i]));
$saltos++;
$num_cols = types_render_field( "num_cols", array());
}
$i=$i-$saltos;
$saltos=0;
}
?>
<ul>
<li><?php the_title(); ?></li>
<li><?php the_permalink(); ?></li>
<li><?php the_time('l F d, Y'); ?></li>
<?php the_content(); ?>
<?php echo types_render_field( "num_cols", array() ); ?>
</ul>
<?php
$columna=$columna+types_render_field( "num_cols", array());
if($columna==5){
$fila++;
$columna=1;
}
}?>