Get approved comments or comments that the author is me
Get approved comments or comments that the author is me
Get approved comments or comments that the author is me
Restrict users to see only own comments and the post author’s replies
Best method for comment section associated with different images?
The last comments of a post for the author of that post
This notice comes because object $comments is null. So the have_comments() must wrap all the thing to be sure there are comments before using any property. in your case : <?php if ( have_comments() ) : /* the code */ endif; ?>
How to show total comments count of the current logged in user?
add this snippet for according your needed: add_shortcode ( ‘show_recent_comments’, ‘show_recent_comments_handler’ ); function show_recent_comments_handler( $atts, $content = null ) { extract( shortcode_atts( array( “count” => 10, “pretty_permalink” => 0 ), $atts )); $output=””; // this holds the output if ( is_user_logged_in() ) { global $current_user; get_currentuserinfo(); $args = array( ‘user_id’ => $current_user->ID, ‘number’ => $count, … Read more
if your above Javascript is working fine and you want to insert that into a page. Kindly add the following code to your functions.php. I have tested this code it’s working fine. function handle_comment_error() { ?> <script> document.getElementById(“comment-error”).innerHTML = “Please enter your comment.”; </script> <?php }add_action(‘wp_head’, ‘handle_comment_error’); Let me know if you face any issues.
prevent get_comments() from returning comments not in comment__in
comment_post (if comment is approved OR $comment_approved === 1) not working?