How to limit specific user ID to 5 comments per post?

This is a simple approach to check whether a user has commented on the post, or not. If they have commented on the post, then disable comment form. global $current_user; $args = array(‘user_id’ => $current_user->ID); $usercomment = get_comments($args); if(count($usercomment) >= 1){ echo ‘Comment form disabled’; } else { comment_form(); }

Comment author profile image

I am also interested and after spending hours to test, read source code and some online docs. Finally understand how it is working. And end up the method is easy but not obvious. Not sure how you add the image, you may modify the code to meet your actual situation and here is the WordPress … Read more

WordPress Custom Local Avatar not showing in comments

I found a solution and now my frontend avatar script is fully functioning. Happy days 🙂 I ended up scrapping the above code and using this. add_filter( ‘pre_get_avatar_data’, ‘wad_avatar_meta’, 10, 2 ); function wad_avatar_meta( $args, $id_or_email ){ $user_avatar_meta_key = ‘avatar’; if( is_object( $id_or_email ) && isset( $id_or_email->comment_ID ) ){ $id_or_email = get_comment( $id_or_email ); } … Read more

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