Bootstrap Theme $variables
The proper way to add a new variables in a class is to use hook_preprocess_page(&amp;$vars) you can add the classes like the following:

$classes = array(
    'classes_main_page' =&gt; '',
    'classes_sidebar_first' =&gt; '',
    'classes_sidebar_second' =&gt; '',
  );

  // Classes when no sidebar
  if(empty($vars['page']['sidebar_first']) &amp;&amp; empty($vars['page']['sidebar_second'])) {
    $classes['classes_main_page'] = 'small-12 medium-12 large-12';
  }
// Classes when left and right sidebars
  if(!empty($vars['page']['sidebar_first']) &amp;&amp; !empty($vars['page']['sidebar_second'])) {
    $classes['classes_main_page'] = 'small-12 medium-6 large-6 columns';
    $classes['classes_sidebar_first'] = 'small-12 medium-3 large-3 columns';
    $classes['classes_sidebar_second'] = 'small-12 medium-3 large-3 columns';
  }

  // Classes when only left sidebar
  if(!empty($vars['page']['sidebar_first']) &amp;&amp; empty($vars['page']['sidebar_second'])) {
    $classes['classes_main_page'] = 'small-12 medium-9 large-9 columns';
    $classes['classes_sidebar_first'] = 'small-12 medium-3 large-3 columns';
  }

  // Classes when only right sidebar
  if(empty($vars['page']['sidebar_first']) &amp;&amp; !empty($vars['page']['sidebar_second'])) {
    $classes['classes_main_page'] = 'small-12 medium-9 large-9 columns';
    $classes['classes_sidebar_second'] = 'small-12 medium-3 large-3 columns';
  }
$vars = array_merge($vars, $classes);


and then in your page.tpl.php print something like this:

Don't forget to clear cache afterwards

&lt;aside class="&lt;?php print $classes_sidebar_second; ?&gt;"&gt; for sidebars
&lt;aside class="&lt;?php print $classes_sidebar_second; ?&gt;"&gt; for main container


Thanks