• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Using Simple Hooks to remove comment date

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Using Simple Hooks to remove comment date

This topic is: not resolved

Tagged: comments, date, Metro, time

  • This topic has 10 replies, 4 voices, and was last updated 13 years, 1 month ago by Brad Dalton.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • March 13, 2013 at 4:54 am #25815
    Nat
    Member

    Hi, is there anyway to use Simple hooks plug in to remove the dates and time from comments. If not, where is the code in CSS File to remove it?

    Using metro themehttp://turkishtravelblog.com

    March 13, 2013 at 5:20 am #25817
    Brad Dalton
    Participant

    This CSS code will hide the date and time:

    .comment-meta {
    display: none;
    }
    

    Paste it at the end of your child themes style.css file.


    Tutorials for StudioPress Themes.

    March 13, 2013 at 8:53 am #25849
    stacyvlasits
    Member

    Brad's solution is probably the best way to solve your problem, but it is a teeny bit hacky in that it leaves html on your page that you really don't want.

    In case anyone is interested, here is a complicated (but cleaner) way to implement this.

    In your functions.php file  add_filter('genesis_comment_list_args', 'my_custom_comment_list_args'). Then define the function:

    function my_custom_comment_list_args($args){

    $args = array(
    'callback' = 'custom_comment_callback_no_date',

    )

    }

    Define a function like this in functions.php (it is a copy of the callback that genesis uses, only without the comment date/time):


    function custom_comment_callback_no_date( $comment, $args, $depth ) {

    $GLOBALS['comment'] = $comment; ?>

    <li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">

    <?php do_action( 'genesis_before_comment' ); ?>

    <div class="comment-header">
    <div class="comment-author vcard">
    <?php echo get_avatar( $comment, $size = $args['avatar_size'] ); ?>
    <?php printf( __( '<cite class="fn">%s</cite> <span class="says">%s:</span>', 'genesis' ), get_comment_author_link(), apply_filters( 'comment_author_says_text', __( 'says', 'genesis' ) ) ); ?>
    </div><!-- end .comment-author -->

    </div>

    <div class="comment-content">
    <?php if ( $comment->comment_approved == '0' ) : ?>
    <p class="alert"><?php echo apply_filters( 'genesis_comment_awaiting_moderation', __( 'Your comment is awaiting moderation.', 'genesis' ) ); ?></p>
    <?php endif; ?>

    <?php comment_text(); ?>
    </div><!-- end .comment-content -->

    <div class="reply">
    <?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    </div>

    <?php do_action( 'genesis_after_comment' );

    /** No ending </li> tag because of comment threading */

    }

    March 13, 2013 at 8:57 am #25852
    Nat
    Member

    Worked a treat. Thank you very much Brad

    March 13, 2013 at 9:00 am #25854
    Nat
    Member

    Sorry Stacy, did not see your reply because was working on the style sheet.

    Unfortunately all of what you said just went totally straight over the top of my head. I am novice when it comes to editing and that is why I wanted to use the simple hooks plug in

    March 13, 2013 at 11:11 am #25883
    Brad Dalton
    Participant

    No worries Nat.

    Stacy, i was actually going to do that but with a smaller amount of code using this:
    http://codex.wordpress.org/Function_Reference/delete_comment_meta

    and write this into a small function but didn't think leaving the comment meta for date and time in the source code would be a problem. Still interested to try and make it work.

    Which Genesis file did you grab all the code from?


    Tutorials for StudioPress Themes.

    March 13, 2013 at 12:06 pm #25894
    stacyvlasits
    Member

    Nat, as I noted, Brad's solution is almost certainly the right choice for you (and probably for most situations).

    Also, Brad, that function really looks like the way to go.

    I took the code from the genesis_comment_callback which is in genesis/lib/structure/comments.php

    April 20, 2013 at 3:47 am #36526
    Brad Dalton
    Participant

    Thanks Stacy. Missed your comment last time.


    Tutorials for StudioPress Themes.

    August 16, 2013 at 3:22 pm #56913
    Jenny
    Member

    What if I just wanna remove the TIME from the comment date? How would I go about doing that. I'm using 2.0 btw~

    August 16, 2013 at 3:51 pm #56918
    Brad Dalton
    Participant

    This CSS code will hide but not remove from the database, all comment meta for date from all posts.

    https://gist.github.com/braddalton/6253744


    Tutorials for StudioPress Themes.

    August 16, 2013 at 5:30 pm #56939
    Brad Dalton
    Participant

    Removing the time can't be done with CSS without removing the date as well.

    You would need to use the WordPress comment form args to filter the output of the comment meta data.

    $args: An array of arguments for controlling the output of the comment form.

    There's no information on filtering it http://codex.wordpress.org/Function_Reference/delete_comment_meta


    Tutorials for StudioPress Themes.

  • Author
    Posts
Viewing 11 posts - 1 through 11 (of 11 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble