Node id of home page
@Oswald: thanks for pointing in the right direction. This snippet does exactly what I need:

$front_url = variable_get('site_frontpage', 'node');
$front_url = trim($front_url, '/');
$front = explode('/', $front_url);
if( $front[0]=='node' &amp;&amp; ctype_digit($front[1]) ) {
  $front_nid = $front[1];
}
echo $front_nid;