Community Forums › Forums › Archived Forums › Design Tips and Tricks › How to Remove Link from Comment Date
Tagged: comment meta
- This topic has 8 replies, 2 voices, and was last updated 10 years, 10 months ago by rfmeier.
-
AuthorPosts
-
June 4, 2013 at 7:06 am #43999June 4, 2013 at 7:41 am #44001rfmeierMember
Hello,
Looking at the Genesis source, as I don't have the Dynamik theme, a filter will need to be created to target a new custom comment callback. The new custom comment callback is used to display each comment within the comment loop. I created a gist that would go within your functions.php. As I said before, I do not have the Dynamik theme, so I am not sure if that theme is using a custom comment callback of it's own.
I hope this helps or points you in the right direction.
June 4, 2013 at 7:50 am #44003RobBergerMemberRyan, thanks for the detailed response. I confess, however, that I was hoping for something a little less complicated. But maybe there is no easy way to remove the link.
June 4, 2013 at 7:55 am #44004rfmeierMemberUnfortunately, I did not see any options or filters to adjust this within the source. There may be another way to do this, but it would still require back-end code. This code actually could be turned into a plugin, but that would require some more work.
Someone feel free to chime in if they know a better solution.
June 6, 2013 at 10:55 am #44358RobBergerMemberRyan, can this code be used with Simple Hooks? I'm sure I'm doing something wrong, but I added it to `genesis_list_comments` Hook, checked the unhook and php boxes, but got the following error:
Parse error: syntax error, unexpected '<' in /nas/wp/www/staging/doughroller/wp-content/plugins/genesis-simple-hooks/plugin.php(126) : eval()'d code on line 33
June 6, 2013 at 11:00 am #44359rfmeierMemberI had this in my functions.php file for testing. I would have to try this out with Simple Hooks yet. Let me give it a quick try and I will get back to you.
June 6, 2013 at 11:21 am #44363rfmeierMemberTo my surprise it worked with Genesis Simple Hooks. I did have to change some of the code. Here is was I entered;
<?php $args = array( 'type' => 'comment', 'avatar_size' => 48, 'callback' => 'genesis_comment_callback', ); // set out custom function $args['callback'] = 'custom_genesis_comment_callback'; $args = apply_filters( 'genesis_comment_list_args', $args ); wp_list_comments( $args ); function custom_genesis_comment_callback( $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 class="comment-meta commentmetadata"> <?php //** Comment date removed ** ?> <span><?php printf( __( '%1$s at %2$s', 'genesis' ), get_comment_date(), get_comment_time() ); ?></span> <?php edit_comment_link( __( '(Edit)', 'genesis' ), '' ); ?> </div><!-- end .comment-meta --> </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 */ } ?>
Note: Make sure to check the following;
Unhook genesis_default_list_comments() function from this hook?
Execute PHP on this hook?Also: Make sure to begin it with
<?php
and end with
?>
I hope this helps.
June 6, 2013 at 11:38 am #44366RobBergerMemberWorked like a charm! Very much appreciate your help.
June 6, 2013 at 11:44 am #44367rfmeierMember -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.