Including the following code:
<?php print 'This page was last modified on ' . date('j F Y', $node->changed);?>
in node.tpl.php
displays the correct information on the site. However, I would like to display it in the footer instead at the end of the content so have moved it to page.tpl.php
.
The problem with this is that on the homepage the following is being displayed:
This page was last modified on 1 January 1970
Which is clearly incorrect.
In addition, These error messages are displayed on every page:
Notice: Undefined variable: node in include() (line 201 of /home/mysite/public_html/sites/all/themes/mysite/templates/page.tpl.php).
Notice: Trying to get property of non-object in include() (line 201 of /home/mysite/public_html/sites/all/themes/mysite/templates/page.tpl.php).
How do I include the Page last updated text in the footer of every page?