Forums

[resolved] How do I show timestamp on comments? (4 posts)

  1. geraldisaacs
    Member
    Posted 5 years ago #

    My website (whs59.net) has no date/time stamps in the comments/replies to all categories. Can someone point me to how to show date/time stamps? The key seems to be in the comments.php file where the line in my file reads as follows:

    <?php comment_type(__(''), __('Trackback'), __('Pingback')); ?> By <?php comment_author_link(); ?>(need timestamp for comment)<?php edit_comment_link(__("Edit This"), ' |'); ?>

    What I want is the date/time stamp for the reply where I have put the string "(need timestamp for comment)"

    I just don't know how to construct the code to replace that string. I thought I had resolved the issue with:

    <?php the_time('F j, Y'); ?> at <?php the_time('g:i a'); ?>

    but this posts the time of the post on all the comments/replies, not the times of the individual comments/replies.

    I need help from someone who can tell me how to extract and print the time of each individual comment/reply.

    I'm know it can be done because page

    http://whs59.net/wordpress/?feed=comments-rss2

    shows the correct timestamps for individual comments/replies. Also, this very post has a time/date stamp on it.

  2. vkaryl
    Member
    Posted 5 years ago #

    In comments.php, put this line where you want to see that:

    <?php comment_date('F j, Y') ?>

    Now, I'm not sure about adding the time there, perhaps someone with more php experience will be able to help.

    Ah. This page explains: Template_Tags/comment_time

  3. geraldisaacs
    Member
    Posted 5 years ago #

    Many thinks.

    <?php comment_date('m/j/y')?>; <?php comment_date('g:i a')?>

    gives me date and time. Issue resolved.

  4. vkaryl
    Member
    Posted 5 years ago #

    Mark this thread so then, please and thanks?

Topic Closed

This topic has been closed to new replies.

About this Topic