Date not showing on pages: (4 posts)

  1. opensecrets
    Posted 10 years ago #

    Hi, I have recently decided to display the date my pages were last updated but the date does not display.

    This is my page.php:

    <?php get_header(); ?>
    <link href="style.css" rel="stylesheet" type="text/css">
    <div class="header">
    <?php the_title(); ?>
    Last Updated: <b><?php the_date(); ?></b><br>
    <div id="content" class="narrowcolumn">

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class="post" id="post-<?php the_ID(); ?>">
    <div class="entrytext">
    <?php the_content('<p class="serif">Read the rest of this page '); ?>

    <?php link_pages('<strong>Pages:</strong> ', '', 'number'); ?>

    <?php endwhile; endif; ?>

    What is wrong?

  2. newflesh
    Posted 10 years ago #

    I think you should use the_time instead of the_date: http://codex.wordpress.org/Template_Tags/the_time

  3. Chris_K
    Posted 10 years ago #

    Have a look at the_date() documentation: http://codex.wordpress.org/Template_Tags/the_date

    It only works when in The_Loop. Now, I'm just guessing here... but suppose you made a small change and moved it to right before
    <div class="entrytext"> ?

  4. opensecrets
    Posted 10 years ago #

    That worked, thank you HandySolo!

Topic Closed

This topic has been closed to new replies.

About this Topic