Drupal - Check if the page is the front page in a template
You should not declare a function in a Drupal template. Instead, you should just refer to that function:
<?php
if (drupal_is_front_page()) {
?><h1>Test</h1><?php
}
?>
drupal_is_front_page()
returns boolean value.
<?php if(drupal_is_front_page()): ?>
<h1>TEST</h1>
<?php endif; ?>