%s', 'chateau' ), get_search_query() ); ?>

post_count; //determine total number of items while ( $the_query->have_posts() ) : $the_query->the_post(); //loop! //set $is_start_of_new_colum true when post count is dividable by the number of items $is_start_of_new_column = 0 === ( $count % $col_size ); //set $is_end_of_column when both $count and $is_start_of_new_column are true $is_end_of_column = ( $count && $is_start_of_new_column ); $count++; //update count counter $is_start_of_new_column && $column++; //update column counter if ( $is_end_of_column ) print( '
' ); if ( $is_start_of_new_column ) print( '
' ); get_template_part( 'content', 'list' ); endwhile; print( '
' ); ?>