Disallow Comments

Go to Settings – Discussion from the left sidebar of your WordPress admin panel. On this page, uncheck the option that says “Allow people to post comments on new articles” and then click on the Save Changes.

Force to show all fields in comment forms to the logged-in users

you can paste the code below in your theme functions.php file, it should generate almost the same comment form for logged in and logged out users add_filter( “comment_form_fields”, function( $comment_fields ) { if( is_user_logged_in() ) { // Get an array of field names, excluding the textarea $comment_field_keys = array_diff( array_keys( $comment_fields ), array( ‘comment’ ) … Read more

I would like to count number of comments after 5 days ago

thank you for WebElain to help me. This answer driving me to the right request. Now it’s ok. It is an object indead and I use something more simple with get_comments () query with parameter count enabled. the final code is like this : #!/usr/bin/php <?php if ( ! defined(‘ABSPATH’) ) { /** Set up … Read more

How do I refresh “Post Last Modified Time”, as long as comment is updated to Approve status?

It’s easy, you can just use different hook to perform same action. add_action( ‘comment_approved_’, ‘update_post_time’, 99, 2); // this will fire when comment is approved regardless of comment type Last underscore in action name is important comment_approved_ as normally after it goes comment-type if you need to hook to approval to specific comment types. See … Read more

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

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