• Resolved hcraig

    (@hcraig)


    Hi there,

    I am using WordPress as a CMS rather than a blog, and have the following code in “footer.php”:

    <?php the_modified_date('Y-m-d H:i:s T'); ?>

    This works on the home page, but is blank on all other pages on the website. All of these pages have been modified since creation.

    I have also tried…

    <?php echo the_modified_date('Y-m-d H:i:s T'); ?>

    … (in other words, adding “echo”) and I have also tried using the_modified_time. In all cases, the last modified date is correctly displayed in the footer on the site’s home page, but the place where there should be a date on other pages is blank.

    Haven’t seen this inconsistency mentioned anywhere else. Anyone have any idea what I might have done wrong?

    Thanks.

    Craig

Viewing 5 replies - 1 through 5 (of 5 total)
  • are put ‘the_modified_date’ in a loop ?

    Thread Starter hcraig

    (@hcraig)

    Thanks for your reply. I don’t know the answer to your question. How much code would you need me to post to determine the answer?

    Thread Starter hcraig

    (@hcraig)

    OK, I had been looking at the information for “The Loop”, but what I was hung up on was that fact that it was working on one page, but not on the rest. This inconsistency didn’t make any sense to me.

    So in “footer.php” I added…

    while (have_posts()) : the_post();

    … before the line reporting the last updated date, and then…

    endwhile;

    … after, and the updated dates now show up on all pages rather than just the home page.

    Thanks for pointing me in the right direction.

    I am using WordPress as a CMS rather than a blog, and have the following code in “footer.php”:

    I’m little bit confused. Are you sure it’s locate in the footer.php ?

    just post yours theme code per file to wordpress.pastebin.ca. Put the link here then i will check why it’s not working. But to make it easy, please just put index.php, footer.php, and single.php

    how about it ?

    ups! you have answered it (i should refresh this page before submit a new answer) 😉

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Page update date not working’ is closed to new replies.