Notices: Undefined index and trying to get property of non-object include() I have a "page--front.tpl.php" and get these notices:


  Notice: Undefined index: nodes include() (line 47 in file /home/dunmicro/public_html/sites/all/themes/dunartis/page--front.tpl.php).
  
  Notice: Trying to get property of non-object include()(line 47 in file /home/dunmicro/public_html/sites/all/themes/dunartis/page--front.tpl.php).


Here is my code:

&lt;?php if ($site_name): ?&gt;
    &lt;?php if ($title): ?&gt;
      &lt;div id="site-name"&lt;?php if ($disable_site_name) { print ' class="hidden"'; } ?&gt;&gt;
        &lt;strong&gt;
          &lt;a href="&lt;?php print $front_page; ?&gt;" title="&lt;?php print t('Home'); ?&gt;" rel="home"&gt;
                      &lt;span&gt;&lt;?php print $page['content']['system_main']['nodes']['63']['#node']-&gt;title; ?&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/strong&gt;
      &lt;/div&gt;
    &lt;?php else: /* Use h1 when the content title is empty */ ?&gt;
      &lt;h1 id="site-name"&lt;?php if ($disable_site_name) { print ' class="hidden"'; } ?&gt;&gt;
        &lt;a href="&lt;?php print $front_page; ?&gt;" title="&lt;?php print t('Home'); ?&gt;" rel="home"&gt;
                    &lt;span&gt;&lt;?php print $page['content']['system_main']['nodes']['63']['#node']-&gt;title; ?&gt;&lt;/span&gt;&lt;/a&gt;
      &lt;/h1&gt;
    &lt;?php endif; ?&gt;
  &lt;?php endif; ?&gt;


How do I fix these notices?
You need to check if $page['content']['system_main']['nodes'] is set or not:

Please check updated code:

&lt;?php if ($site_name): ?&gt;
    &lt;?php if ($title): ?&gt;
      &lt;div id="site-name"&lt;?php if ($disable_site_name) { print ' class="hidden"'; } ?&gt;&gt;
        &lt;strong&gt;
          &lt;a href="&lt;?php print $front_page; ?&gt;" title="&lt;?php print t('Home'); ?&gt;" rel="home"&gt;
                      &lt;span&gt;
&lt;?php if(isset($page['content']['system_main']['nodes'])):?&gt;
&lt;?php print $page['content']['system_main']['nodes']['63']['#node']-&gt;title; ?&gt;
&lt;?php endif;?&gt;
&lt;/span&gt;&lt;/a&gt;
        &lt;/strong&gt;
      &lt;/div&gt;
    &lt;?php else: /* Use h1 when the content title is empty */ ?&gt;
      &lt;h1 id="site-name"&lt;?php if ($disable_site_name) { print ' class="hidden"'; } ?&gt;&gt;
        &lt;a href="&lt;?php print $front_page; ?&gt;" title="&lt;?php print t('Home'); ?&gt;" rel="home"&gt;
                    &lt;span&gt;
&lt;?php if(isset($page['content']['system_main']['nodes'])):?&gt;
&lt;?php print $page['content']['system_main']['nodes']['63']['#node']-&gt;title; ?&gt;
&lt;?php endif;?&gt;
&lt;/span&gt;&lt;/a&gt;
      &lt;/h1&gt;
    &lt;?php endif; ?&gt;
  &lt;?php endif; ?&gt;