• 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

romove time from comment

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 › romove time from comment

This topic is: not resolved

Tagged: comments, time

  • This topic has 2 replies, 2 voices, and was last updated 9 years, 1 month ago by famarinu.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • March 26, 2017 at 11:43 pm #203856
    famarinu
    Member

    Hi, I want remove the time from the comment.
    I set the time format of customized and leave a the field blank. But in the post leaves me the word "at" how can I delete it?

    See attachments:
    https://www.dropbox.com/s/9czg3j9zmd3yoy3/Screen%20Shot%202017-03-27%20at%209.37.02%20AM.jpg?dl=0

    https://www.dropbox.com/s/dztblb3fd0n758i/Screen%20Shot%202017-03-27%20at%209.38.21%20AM.jpg?dl=0

    March 27, 2017 at 6:51 am #203873
    Victor Font
    Moderator

    Unfortunately, there's no filter for this. The date and time are hard coded into the comments display. So to remove the time, you have to write your function to replace the Genesis function:

    add_filter( 'genesis_comment_list_args', 'my_custom_comment_callback' );
    function my_custom_comment_callback( $defaults ) {
    
        $defaults['callback'] = genesis_html5() ? 'my_html5_comment_callback' : 'genesis_comment_callback';
        return $defaults;
    }
    
    function my_html5_comment_callback( $comment, array $args, $depth ) {
        $GLOBALS['comment'] = $comment; ?>
    
    	<li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">
    	<article <?php echo genesis_attr( 'comment' ); ?>>
    
    		<?php do_action( 'genesis_before_comment' ); ?>
    
    		<header <?php echo genesis_attr( 'comment-header' ); ?>>
    			<p <?php echo genesis_attr( 'comment-author' ); ?>>
    				<?php
    				echo get_avatar( $comment, $args['avatar_size'] );
    
    				$author = get_comment_author();
    				$url    = get_comment_author_url();
    
    				if ( ! empty( $url ) && 'http://' !== $url ) {
    					$author = sprintf( '<a href="%s" %s>%s</a>', esc_url( $url ), genesis_attr( 'comment-author-link' ), $author );
    				}
    
    				/**
    				 * Filter the "comment author says" text.
    				 *
    				 * Allows developer to filter the "comment author says" text so it can say something different, or nothing at all.
    				 *
    				 * @since unknown
    				 *
    				 * @param string $text Comment author says text.
    				 */
    				$comment_author_says_text = apply_filters( 'comment_author_says_text', __( 'says', 'genesis' ) );
    
    				if ( ! empty( $comment_author_says_text ) ) {
    					$comment_author_says_text = '<span class="says">' . $comment_author_says_text . '</span>';
    				}
    
    				printf( '<span itemprop="name">%s</span> %s', $author, $comment_author_says_text );
    				?>
    			</p>
    
    			<?php
    			/**
    			 * Allows developer to control whether to print the comment date.
    			 *
    			 * @since 2.2.0
    			 *
    			 * @param bool   $comment_date Whether to print the comment date.
    			 * @param string $post_type    The current post type.
    			 */
    			$comment_date = apply_filters( 'genesis_show_comment_date', true, get_post_type() );
    
    			if ( $comment_date ) {
    				printf( '<p %s>', genesis_attr( 'comment-meta' ) );
    				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() );
    				echo    '</a></time></p>';
    			}
    
    			edit_comment_link( __( '(Edit)', 'genesis' ), ' ' );
    			?>
    		</header>
    
    		<div <?php echo genesis_attr( 'comment-content' ); ?>>
    			<?php if ( ! $comment->comment_approved ) : ?>
    				<?php
    				/**
    				 * Filter the "comment awaiting moderation" text.
    				 *
    				 * Allows developer to filter the "comment awaiting moderation" text so it can say something different, or nothing at all.
    				 *
    				 * @since unknown
    				 *
    				 * @param string $text Comment awaiting moderation text.
    				 */
    				$comment_awaiting_moderation_text = apply_filters( 'genesis_comment_awaiting_moderation', __( 'Your comment is awaiting moderation.', 'genesis' ) );
    				?>
    				<p class="alert"><?php echo $comment_awaiting_moderation_text; ?></p>
    			<?php endif; ?>
    
    			<?php comment_text(); ?>
    		</div>
    
    		<?php
    		comment_reply_link( array_merge( $args, array(
    			'depth'  => $depth,
    			'before' => sprintf( '<div %s>', genesis_attr( 'comment-reply' ) ),
    			'after'  => '</div>',
    		) ) );
    		?>
    
    		<?php do_action( 'genesis_after_comment' ); ?>
    
    	</article>
    	<?php
    	// No ending </li> tag because of comment threading.
    }

    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    March 27, 2017 at 7:24 am #203892
    famarinu
    Member

    Thank you!

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 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