this code reads from theme.info, and media_queries = 5. in preprocess_page $media_queries = theme_get_setting('media_queries'); $grid_width = ''; $i = 1; while($i <= $media_queries) { $grid_width .= $grid['prefix' . $i] . $grid['width' . $i] . ' '; $i++; } $variables['grid_width'] = $grid_width; in page.tpl.php