• Small, though interesting, problem. I am used to have the timestamp following each of my posts. (http://www.carnetsdetoile.ca/wp) Now, if I need an update to any post, I want it to follow the timestamp, so that it features a time that is chronologically latter than the one of the post. The code in the index.php looks like this:

    <div class="post">
    <?php the_date(("l d F Y"),'<h3>','</h3>');?>
    <div class="storycontent">
    <?php the_content(); ?>
    <h3 class="storytitle" id="post-<?php the_ID(); ?>">" rel="bookmark" title="lien permanent: <?php the_time() ?>"> <?php the_time("\\(H\\hi\\)");?> </h3>
    </div>
    </div>
    <?php endforeach; else: ?>
    <?php _e('Désolés, aucune donnée ne correspond à votre requête.'); ?>
    <?php endif; ?>
    </div>

    Now, how can I do that if the php the_time is the last thing in the loop?
    JP

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter jpierre

    (@jpierre)

    sorry for the mess. Don’t know what happened.

    I’m not understanding if you have a question or pointing out something you did.
    Do you just want things chronological on any given day? But day to day in reverse chronological order? I’m confused.
    You can move anything around inside the foreach loop and still get the appropriate data for each post.

    Edit the post. If you want to change the timestamp, check the box on the edit screen and change the date/time.

    I think you’re going to have to include that manually, because otherwise WP would have to keep track of the date/time of every single update and it doesn’t do that. It keeps posted time and modified time. So if you modify it several times it only keeps the last time.

    You could probably make a quicktag to add the timestamp.

    Does the following do what you want?
    (timestamp)

    if ("$post->post_modified_gmt" <> "$post->post_date_gmt") {
    print("update: $post->post_modified");
    //NOTE: See www.php.net/date for formatting options
    }

    There will be the date you originally made the post (or the date you edit it to), at the bottom.
    MtDewVirus is right, you will want to add in the date manually with the edit. Keep in mind, the original post date will still appear at the bottom of the post – with the way you have it set up now.
    A more intuitive way, would be to have the original post date appear at the top of the post. Then consequently when you use <Ins>, followed by your update, things will appear in proper sequential order to your reader.

    Thread Starter jpierre

    (@jpierre)

    Right. I see that I had it wrong. So it works, and the quicktag works too. I’ll have to make a few changes to the date and time format. Good tips. Beel, champion of the quicktags!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘timestamp IN the post’ is closed to new replies.