If else for main menu im trying to do a if else statement for the main menu, i have something like this but i dont know where to begin.

&lt;?php if ( !$is_front ) : ?&gt;
function bartik_links__system_main_menu($variables) {
  $output = '';
  foreach ($variables['links'] as $link) {
    $output .= l('&lt;h2&gt;'. check_plain($link['title']) .'&lt;/h2&gt;', $link['href'], $link);
  }
  return $output;
}

&lt;?php else: ?&gt;

function bartik_links__system_main_menu($variables) {
  $output = '';
  foreach ($variables['links'] as $link) {
    $output .= l(''. check_plain($link['title']) .'', $link['href'], $link);
  }
  return $output;
}
&lt;?php endif ?&gt;


as you can see i want the tags on the front page and if it isnt then i want the tags to disappear.
Not sure where/when this function is called, but here's your code with some fixes:

function bartik_links__system_main_menu($variables) {
    $output = '';
    $prefix = drupal_is_front_page() ? '' : '&lt;h2&gt;';
    $suffix = drupal_is_front_page() ? '' : '&lt;/h2&gt;';

    foreach ($variables['links'] as $link) {
        $output .= l($prefix.check_plain($link['title']).$suffix, $link['href'], $link);
    }
    return $output;
}