Print primary and secondary tabs separately I am creating subtheme of bartik theme.

According to page.tpl.php file of Bartik theme it shows that tabs can be printed by following code.

&lt;?php if ($tabs): ?&gt;
  &lt;div class="tabs"&gt;
    &lt;?php print render($tabs); ?&gt;
  &lt;/div&gt;
&lt;?php endif; ?&gt;


The above code prints primary and secondary tabs at a single place.

Now i want to print primary and secondary tabs seperately in template file.

Is there any variable which gives me the primary and secondary tabs seperately ?
Finally I ended up like this:

&lt;?php 
  $primary = menu_primary_local_tasks();
?&gt;
&lt;ul class="tabs primary primary-with-secondary clear-block"&gt;&lt;?php print render($primary); ?&gt;&lt;/ul&gt;


The above code will return the primary links:

To print the secondary links

 if ($secondary = menu_secondary_local_tasks()) {
    $output .= "&lt;ul class=\"tabs secondary clear-block\"&gt;\n". $secondary ."&lt;/ul&gt;\n";
  }


Above code will return the secondary links for the theme.