comments.php keep comment date/time but remove date/time’s #hyperlink

To keep the date/time text, you have to do minor modification in comments.php just add call back argument in wp_list_comments function. <?php wp_list_comments( array( ‘callback’ => ‘custom_format_comment_listing’ ) ); ?> Then add Following code in your functions.php file. you can modification other html as per your design. <?php function custom_format_comment_listing($comment, $args, $depth) { $GLOBALS[‘comment’] = … Read more

How to auto empty comment trash after X days

When deleting a comment it’s possible to use the second input argument: wp_delete_comment( $comment, $force_delete = true ) to delete it permanently and avoiding the trash bin. You could try to adjust your scheduled script accordingly. There’s also the EMPTY_TRASH_DAYS constant, that’s default set to empty the trash bin after 30 days, but it will … Read more

How to moderate (manually approve) comments of a specific (registered) User

If you are comfortable with coding, you could try a custom filter based on the WP_Comment object. Perhaps something like the following: function wpse_wp_insert_comment($id, $comment) { // Add your user_id, or use email address instead. if ( empty($comment->comment_author ) || $comment->user_id!== 1 ) wp_set_comment_status( $comment, ‘hold’ ); } add_action(‘wp_insert_comment’, ‘wpse_wp_insert_comment’, 10, 2); -Or … // … Read more

Show comments menu in dashboard only if the site has comment

Okay, the solution is this below to hide Comments menu if the site doesn’t have any comments (approved, pending, trash or spam). function remove_commentsmenu() { global $user_ID; if ( 1 > wp_count_comments( get_the_ID() )->total_comments && 1 > wp_count_comments( get_the_ID() )->trash ) { remove_menu_page( ‘edit-comments.php’ ); } } add_action( ‘admin_menu’, ‘remove_commentsmenu’ );

How to call my custom WordPress Comment form without getting the comments?

Yes, You can customize the comment form with the Bootstrap 4. You just need to do some edits with bootstrap classes and HTML. $args = array( ‘comment_field’ => ‘<p class=”comment-form-comment”><label for=”comment”>’ . _x( ‘Comment’, ‘noun’ ) . ‘</label><textarea id=”comment” name=”comment” cols=”45″ rows=”8″ aria-required=”true”></textarea></p>’ ‘fields’ => apply_filters( ‘comment_form_default_fields’, array( ‘author’ => ‘<p class=”comment-form-author”>’ . ‘<label for=”author”>’ … Read more

How to change avatar of the comment author using comment ID?

You can use pre_get_avatar filter to manipulate comment avatar html and stop WP from getting a default avatar for the comment. Passing a non-null value will effectively short-circuit get_avatar(), passing the value through the ‘get_avatar’ filter and returning early. E.g. add_filter( ‘pre_get_avatar’, ‘my_filter_pre_get_avatar’, 10, 3 ); function my_filter_pre_get_avatar( $avatar_html, $id_or_email, $args ) { if ( … Read more

Removing the limit on the number of nested comments

thread_comments_depth is the option you need to change, and while the dropdown gives you several predefined values, the option can store any value. So if you use the dev tools to adjust the dropdown to add a 9999 option, you can set it to a max of 9999 nested comments, or more even. You can … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)