Show comments from multiple post IDs in comment template

you can get comments from each post by its id with $comments253 = get_comments(‘post_id=253’); $comments724 = get_comments(‘post_id=724’); $comments798 = get_comments(‘post_id=798’); then merge ( array-merge ) and sort the array by date ( comment->comment_date being the key to the date value) if you want. then just foreach($comments as $comment) : echo($comment->comment_author . ‘<br />’ . $comment->comment_content); … Read more

How to add filter in “Comments” at the admin panel?

Working Example [Update] From this Answer, by @TheDeadMedic, here’s an adaptation to show only comments from a specific post_id. A link to this action is inserted in the status row. Hello World is the post with ID 53. When clicked it displays only the comments of that post in the URL example.com/wp-admin/edit-comments.php?comment_status=all&hello_world=1: add_action( ‘current_screen’, ‘wpse_72210_comments_exclude_lazy_hook’, … Read more

Success message in comment form

Without Ajax or plugins. Add to function.php: add_action( ‘set_comment_cookies’, function( $comment, $user ) { setcookie( ‘ta_comment_wait_approval’, ‘1’ ); }, 10, 2 ); add_action( ‘init’, function() { if( $_COOKIE[‘ta_comment_wait_approval’] === ‘1’ ) { setcookie( ‘ta_comment_wait_approval’, null, time() – 3600, “https://wordpress.stackexchange.com/” ); add_action( ‘comment_form_before’, function() { echo “<p id=’wait_approval’ style=”padding-top: 40px;”><strong>Your comment has been sent successfully.</strong></p>”; }); … Read more

Parent comment’s author name

In your comment callback, you could get that info with the help of the comment_parent property of the current $comment object. We can then use the comment_author() function to display the comment author’s name: // Display the parent comment author’s name: if( $comment->comment_parent ) comment_author( $comment->comment_parent ); and the comment_author_link() function to display the comment … Read more

Link name in comments to Author page? Comment Author Meta in Comments?

Edited my answer since the original code was slightly flawed. Tested and triplechecked this to make sure it does exactly what you’ve requested. 🙂 Enjoy! function comment_author_profile_link(){ /* Get the comment author information */ global $comment; $comment_ID = $comment->user_id; $author = get_comment_author( $comment_ID ); $url = get_comment_author_url( $comment_ID ); /* Check if commenter is registered … Read more

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