- This topic has 5 replies, 2 voices, and was last updated 4 years, 2 months ago by Leo.
Viewing 6 posts - 1 through 6 (of 6 total)
-
AuthorPosts
-
February 19, 2020 at 10:05 am #1170689Juan Carlos
Hello.
How can I hide de date of the comments? I dont want hide it with CSS, I want to remove because it is a best practice to SEO.
Thanks.
February 19, 2020 at 10:22 am #1170708LeoStaffCustomer SupportHi there,
In that case you’d need a child theme and copy this function in the child theme’s
function.php
if ( ! function_exists( 'generate_comment' ) ) { /** * Template for comments and pingbacks. * * Used as a callback by wp_list_comments() for displaying the comments. */ function generate_comment( $comment, $args, $depth ) { $args['avatar_size'] = apply_filters( 'generate_comment_avatar_size', 50 ); if ( 'pingback' == $comment->comment_type || 'trackback' == $comment->comment_type ) : ?> <li id="comment-<?php comment_ID(); ?>" <?php comment_class(); ?>> <div class="comment-body"> <?php _e( 'Pingback:', 'generatepress' ); // WPCS: XSS OK. ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( 'Edit', 'generatepress' ), '<span class="edit-link">', '</span>' ); ?> </div> <?php else : ?> <li id="comment-<?php comment_ID(); ?>" <?php comment_class( empty( $args['has_children'] ) ? '' : 'parent' ); ?>> <article id="div-comment-<?php comment_ID(); ?>" class="comment-body" <?php generate_do_microdata( 'comment-body' ); ?>> <footer class="comment-meta"> <?php if ( 0 != $args['avatar_size'] ) { echo get_avatar( $comment, $args['avatar_size'] ); } ?> <div class="comment-author-info"> <div class="comment-author vcard" <?php generate_do_microdata( 'comment-author' ); ?>> <?php printf( '<cite itemprop="name" class="fn">%s</cite>', get_comment_author_link() ); ?> </div><!-- .comment-author --> <div class="entry-meta comment-metadata"> <a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>"> </a> <?php edit_comment_link( __( 'Edit', 'generatepress' ), '<span class="edit-link">| ', '</span>' ); ?> </div><!-- .comment-metadata --> </div><!-- .comment-author-info --> <?php if ( '0' == $comment->comment_approved ) : ?> <p class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'generatepress' ); // WPCS: XSS OK. ?></p> <?php endif; ?> </footer><!-- .comment-meta --> <div class="comment-content" itemprop="text"> <?php /** * generate_before_comment_content hook. * * @since 2.4 * */ do_action( 'generate_before_comment_text', $comment, $args, $depth ); comment_text(); /** * generate_after_comment_content hook. * * @since 2.4 * */ do_action( 'generate_after_comment_text', $comment, $args, $depth ); ?> </div><!-- .comment-content --> </article><!-- .comment-body --> <?php endif; } }
February 19, 2020 at 10:39 am #1170721Juan CarlosWould it work if I add the code in the Code Snippets plugin?
February 19, 2020 at 10:40 am #1170723LeoStaffCustomer SupportUnfortunately not. I actually just tested this and confirmed with Tom.
Child theme is needed until we add a filter in the future.
February 26, 2020 at 9:56 am #1177784Juan CarlosIt works.
Thanks!
February 26, 2020 at 10:52 am #1177843LeoStaffCustomer SupportNo problem 🙂
-
AuthorPosts
Viewing 6 posts - 1 through 6 (of 6 total)
- You must be logged in to reply to this topic.