Make WordPress Core

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#10673 closed enhancement (worksforme)

Some class for date/hour of comments

Reported by: newzic's profile Newzic Owned by:
Milestone: Priority: low
Severity: minor Version: 2.8.4
Component: General Keywords: comment
Focuses: Cc:


I would like on some website, to hide the hour of comment.

2 ideas:

  1. a class for date and hour
    <span class="comment-date>23/08/2009</span><span> at </span><span class="comment-hour>2:30 am</span>

with that, we can customize all as we want (for me, I will hide " at " and "2:30 am").

  1. An option in admin to not display the hour

(or the both ideas).

Change History (3)

#1 @thee17
14 years ago

  • Milestone Unassigned deleted
  • Resolution set to worksforme
  • Status changed from new to closed

This is totally customizable by your theme's comments.php, if your theme does not have one you can copy it from the default theme and modify it.

#2 @Newzic
14 years ago

But comment meta data are in wp-includes/comment-template.php, line 1268

<div class="comment-meta commentmetadata"><a href="<?php echo htmlspecialchars( 
get_comment_link( $comment->comment_ID ) ) ?>"><?php printf(__('%1$s at %2$s'), get_comment_date(),  get_comment_time()) ?></a><?php edit_comment_link(__('(Edit)'),'&nbsp;&nbsp;','') ?></div>

not in comment.php of the defaut theme. comment.php have

<?php wp_list_comments();?>

that call code in wp-includes/comment-template.php

#3 @ionfish
14 years ago

You can customise the output of the wp_list_comments function by specifying a custom walker class.

Note: See TracTickets for help on using tickets.