Community Forums › Forums › Archived Forums › General Discussion › How to remove comment dates
Tagged: comment metadata, Daily Dish, shortcode, simple edits
- This topic has 6 replies, 4 voices, and was last updated 9 years ago by Carlo.
-
AuthorPosts
-
January 15, 2015 at 5:09 pm #137604January 15, 2015 at 6:11 pm #137607AblandMember
How about this in your style rules?
p.comment-meta .comment-time {
display: none;
}January 15, 2015 at 7:58 pm #137610JenniferNMMemberThanks for the suggestion, Abland. Tried that, but it didn't work. It also didn't look like anything else in the comments section.
/* Comments
--------------------------------------------- */.comment-respond,
.entry-comments,
.entry-pings {
margin-bottom: 40px;
}.comment-header {
font-size: 16px;
}li.comment {
background-color: #f5f5f5;
border: 2px solid #fff;
border-right: none;
}.comment-content {
clear: both;
}.comment-list li {
margin-top: 24px;
padding: 32px;
}.comment-list li li {
margin-right: -32px;
}.comment-respond input[type="email"],
.comment-respond input[type="text"],
.comment-respond input[type="url"] {
width: 50%;
}.comment-respond label {
display: block;
margin-right: 12px;
}.entry-comments .comment-author {
margin-bottom: 0;
}.entry-pings .reply {
display: none;
}.bypostauthor {
}January 16, 2015 at 1:32 pm #137694Ren VenturaMemberHide the entire comment-meta element.
.comment-meta { display: none; }
That should work but, if it doesn't for some reason, add the !important declaration, like so:
.comment-meta { display: none !important; }
Web & Software Developer & Blogger | RenVentura.com | Follow Me on Twitter @CLE_Ren
January 30, 2015 at 12:51 pm #139069JenniferNMMemberThank you, Ren - I'll try that and report back! Cheers. 🙂
January 30, 2015 at 4:46 pm #139089CarloMemberHi Jennifer. Using
display: none;
is not a very good solution because the dates will still be there in the source code.Instead, I've prepared some code that you can add to your theme functions to properly remove the dates.
function jennifer_comment_callback( $comment, array $args, $depth ) { ob_start(); genesis_html5_comment_callback( $comment, $args, $depth ); $all_content = ob_get_clean(); ob_start(); ?><p <?php echo genesis_attr( 'comment-meta' ); ?>> <?php printf( '<time %s>', genesis_attr( 'comment-time' ) ); printf( '<a href="%s" %s>', esc_url( get_comment_link( $comment->comment_ID ) ), genesis_attr( 'comment-time-link' ) ); echo esc_html( get_comment_date() ) . ' ' . __( 'at', 'genesis' ) . ' ' . esc_html( get_comment_time() ); echo '</a></time>'; edit_comment_link( __( '(Edit)', 'genesis' ), ' ' ); ?> </p><?php $content_to_remove = ob_get_clean(); echo str_replace( $content_to_remove, '', $all_content ); } add_filter( 'genesis_comment_list_args', function( $defaults ) { $defaults[ 'callback' ] = 'jennifer_comment_callback'; return $defaults; } );
Let me know if that works.
March 24, 2015 at 1:50 am #145425CarloMemberI recently published a tutorial on this topic:
http://carlomanf.id.au/remove-comment-dates/There will be a filter for this in Genesis 2.2.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.