diff --git theme/theme.inc theme/theme.inc index abd8b9b..0dda6c3 100644 --- theme/theme.inc +++ theme/theme.inc @@ -394,14 +394,21 @@ function template_preprocess_views_view_grid(&$vars) { if ($options['alignment'] == 'horizontal') { $row = array(); + $row_count = 0; foreach ($vars['rows'] as $count => $item) { $row[] = $item; + $row_count ++; if (($count + 1) % $columns == 0) { $rows[] = $row; $row = array(); + $row_count = 0; } } if ($row) { + // Fill up the last line. + for ($i = 0; $i < ($columns - $row_count); $i++) { + $row[] = ''; + } $rows[] = $row; } }