Add a Comment on/off option in Screen Options for Comments?

To achieve this, you should filter the manage_edit-comments_columns filter to remove the core comment column, and add a custom comment column so the checkbox shows up in the screen options tab. For the output of comments, you would then need to get comment_content from the comment for display output in the manage_comments_custom_column hook. This is … Read more

301 Redirection After Comment

If you have a thank-you-page with same slug in all sites you can do: add_action(‘comment_post_redirect’, ‘redirect_to_thank_page’); function redirect_to_thank_page() { return get_bloginfo(‘url’).’/thank-you-page’; } get_bloginfo(‘url’) detects the subsite you’re currently in

Author comment count in author page

all you have to do is to add an param: /* user commnet count */ function get_comment_count( $user_ID ) { global $wpdb; $count = $wpdb->get_var( $wpdb->prepare( “SELECT COUNT(comment_ID) FROM {$wpdb->comments} WHERE user_id = %d “, $user_ID ) ); return $count; } <?php echo get_comment_count( <USER_ID> ); ?> PS. I’ve added some proper escaping in your … Read more

How to style archive post titles… but only those posts who have comments?

Use have_comments() function. Example: <?php if ( have_comments() ) : ?> <h2 class=”has-comments”><a href=”https://wordpress.stackexchange.com/questions/363222/<?php the_permalink(); ?>”><?php the_title(); ?></a></h2> <?php else : ?> <h2><a href=”https://wordpress.stackexchange.com/questions/363222/<?php the_permalink(); ?>”><?php the_title(); ?></a></h2> <?php endif; ?>

Where are comment ratings stored?

As stated in the comments below the question, Comments don’t have ratings in WordPress I went on and inspected the HTML source for one of my posts and figured out which plugin generated the rating based on the CSS class name. I should have known better. The plugin is Tasty Recipes by WP Tasty. I … Read more

Keep comments but turn off commenting

What you’re describing is theme specific. The default themes don’t do this, and instead simply state that comments are closed: If comments are turned off, they change the comment form. But your theme appears to change the entire comment section instead of just the form. You’re going to have to either modify your theme or … Read more

Remove Comment Author Link only for subscribers

This doesn’t feel very nice since it calls get_comment() and get_userdata(), but I’m not sure there’s an obvious better way since the code that calls this doesn’t pass in the records we need: function remove_comment_author_link( $return, $author, $comment_ID ) { $comment = get_comment( $comment_ID ); if ( $comment && $comment->user_id ) { $user = get_userdata( … Read more

How to display comments length

I used this: function wpb_countx() { wp_enqueue_script(‘jquery’); ?> <script> jQuery(function($) { // configure var comment_input = $( ‘#commentform textarea’ ); var submit_button = $( ‘#commentform .form-submit’ ); var comment_limit_chars = 1400; // stop editing here // display how many characters are left $( ‘<div class=”comment_limit_info”><span>’ + comment_limit_chars + ‘</span> zbývá znaků</div>’ ).insertAfter( comment_input ); comment_input.bind( … Read more