comment #respond login members
-
How make comments #respond/.comments-respond can see only members?
function mytheme_comment($comment, $args, $depth) { if ( 'div' === $args['style'] ) { $tag = 'div'; $add_below = 'comment'; } else { $tag = 'li'; $add_below = 'div-comment'; } ?> <<?php echo $tag ?> <?php comment_class( empty( $args['has_children'] ) ? '' : 'parent' ) ?> id="comment-<?php comment_ID() ?>"> <?php if ( 'div' != $args['style'] ) : ?> <div class="comment-body"> <?php endif; ?> <?php comment_text(); ?> <?php if ( $args['avatar_size'] != 0 ) echo get_avatar( $comment, $args['avatar_size'] ); ?> <?php printf( __( '<h2 class="fn">%s</h2>' ), get_comment_author_link() ); ?> <?php if ( $comment->comment_approved == '0' ) : ?> <em class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.' ); ?></em> <br /> <?php endif; ?> <div class="comment-meta commentmetadata"> <?php printf( __('%1$s at %2$s'), get_comment_date(), get_comment_time() ); ?> <div class="reply"> <?php comment_reply_link( array_merge( $args, array( 'add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?> </div> <?php if ( 'div' != $args['style'] ) : ?> </div> <?php endif; ?> <?php } <div id="comments" class="comments-area"> <?php if ( have_comments() ) : ?> <h2 class="comments-title"> <?php $comments_number = get_comments_number(); if ( 1 === $comments_number ) { /* translators: %s: post title */ printf( _x( 'One Comment on “%s”', 'comments title', 'PS' ), get_the_title() ); } else { printf( /* translators: 1: number of comments, 2: post title */ _nx( '%1$s Comments Added on “%2$s”', '%1$s Comments Added on “%2$s”', $comments_number, 'comments title', 'PS' ), number_format_i18n( $comments_number ), get_the_title() ); } ?> </h2> <ul id="commentlist" class="commentlist"> <?php wp_list_comments( 'type=comment&callback=mytheme_comment' ); ?> </ul> <?php endif; // Check for have_comments(). ?> <?php $comments_args = array( // Change the title of send button 'label_submit' => __( '', 'textdomain' ), // Change the title of the reply section 'title_reply' => __( '', 'textdomain' ), // Remove "Text or HTML to be displayed after the set of comment fields". 'comment_notes_after' => '', // Redefine your own textarea (the comment body). 'comment_field' => '<input type="text" id="comment" class="comment-form-comment" placeholder="Your comment" name="comment" />', ); comment_form( $comments_args ); /*nuo kito puses rykiuotu*/ if (!function_exists('iweb_reverse_comments')) { function iweb_reverse_comments($comments) { return array_reverse($comments); } } add_filter ('comments_array', 'iweb_reverse_comments'); ?> </div><!-- .comments-area -->
The topic ‘comment #respond login members’ is closed to new replies.