How do I add class to an admin comment?

One way to add some custom class to a li tag if the comment was posted by an administrator is to replace line <li id=”comment-<?php comment_ID() ?>”> with <li <?php comment_class(); ?> id=”comment-<?php comment_ID() ?>”> This will add support for the default WP comments classes to your comments callback. Once you do that add in … Read more

Alter required message using comment form api

What you need to use is comment_form_defaults filter that has large and nested $defaults array passed. That array will have (among other things) something like this in it: fields author << this will have something like <span class=”required”>*</span> in it email << this will have something like <span class=”required”>*</span> in it url comment_notes_before << this … Read more

comments_number not displaying

You need to change the code you’re using from <div class=”post-meta”> <p><?php the_date(); ?> | <?php the_tags(‘tags:’, ‘, ‘, ‘<br />’); ?> | <?php comments_number( $zero, $one, $more ); ?> comments</p> <?php comments_template(); ?> </div><!– end post-meta –> to <div class=”post-meta”> <p><?php the_date(); ?> | <?php the_tags(‘tags:’, ‘, ‘, ‘<br />’); ?> | <?php comments_number( … Read more

How do i hide all comments from logged out users

I would recommend looking for all occurrences of comments_template in your theme and wrapping them in a is_user_logged_in condiational. Example: <?php if (is_user_logged_in()) { comments_template(); } Alternatively, you can open up your theme’s comments.php (or the equivalent, it’s usually comments.php) and add something like this at the very top: <?php if (!is_user_logged_in()) { return; } … Read more