WordPress.org

Ready to get started?Download WordPress

Forums

Date not showing on pages: (4 posts)

  1. opensecrets
    Member
    Posted 7 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(); ?>
    </div>
    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'); ?>

    </div>
    </div>
    <?php endwhile; endif; ?>
    </div>

    What is wrong?

  2. newflesh
    Member
    Posted 7 years ago #

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

  3. Chris_K
    Member
    Posted 7 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
    Member
    Posted 7 years ago #

    That worked, thank you HandySolo!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags