Clicking Comment "Reply" Button only replies to first comment

I'm editing my comments.php, and within it I've added a reply button like this: <div class="reply"> <a rel="nofollow" class="comment-reply-link" href=<?php comment_reply_link(array('reply_text' => 'Reply this comment'), comment_ID()); ?> data-commentid="3" data-postid="487" data-belowelement="div-comment-3" data-respondelement="respond" data-replyto="Reply to admin" aria-label="Reply to admin"> Reply </a> </div> When I click on the "reply" button under any comment, the comment form pops up beneath the first comment, and only replies to the first one, rather than the one I clicked on. Can anyone explain the errors in this …
Category: Web

How to filter comments by comment_meta

EDIT: Yay, solved it! I needed to use new WP_Comment_Query( $args ) and set my $args to only include the current post and the meta chosen. Thanks! Thanks to the wonderful help of the community here, I have created a dropdown menu above my comments section to choose between BUY | SELL | TRADE | TALK. EDIT: I've changed my comment.php file. It now filters by comment_meta - YAY! Except, it gets ALL comments with this meta value. How do …
Category: Web

How to create a classified section in place of comments_template

I am running a site where users can find great information about musical artists and their releases. Each release is a wordpress post. Each artist is a wordpress post. In my single-artist.php and my single-release.php, i use comments_template(); EDIT: here is my comments.php comment_form(); if (have_comments()) : $wantto= get_comment_meta( $comment_id, 'wantto', true ); echo '<ol class="post-comments">'; wp_list_comments(array( 'style' => 'ol', 'short_ping' => true, )); echo $wantto; echo '</ol>'; endif; It just shows a text box. Here's an example of a …
Category: Web

comment_form() not showing on custom post type

I'm using Gravity Forms to create entries from forms, and Gravity View to display these entries on the Front-End. By default, Gravity Forms and Gravity View doesn't have a comment system for the entries, so the idea is, creating a custom comment system. I could do this easier, using custom post types to store and display entries as posts, having comments enabled, but Gravity Views has sorting, advanced search, display modes and such. So on the other side, it wouldn't …
Category: Web

Display the list of user's comments + the post title + date

I am trying to display the current user's ALL comments in a specific page and I'm using this code (uses a shortcode): https://blog.ashfame.com/2011/01/show-recent-comments-particular-user-wordpress/ And have modified it: <?php /* Plugin Name: Show Recent Comments by a particular user Plugin URI: http://blog.ashfame.com/?p=876 Description: Provides a shortcode which you can use to show recent comments by a particular user Author: Ashfame Author URI: http://blog.ashfame.com/ License: GPL Usage: */ add_shortcode ( 'show_recent_comments', 'show_recent_comments_handler' ); function show_recent_comments_handler( $atts, $content = null ) { extract( …
Category: Web

Wordpress comment processing . Default unapproved comments detection before posting

I am working on wordpress comment section. I understand that when we are posting some comments for example comments with many links, then WordPress storing this comment in to the database with unapproved status. As the result in the website admin comment section, we can see that these comments are coming as unapproved (red background color.). I want to know which function wordpress uses for this. And I want to use that function inside my custom code so that before …
Category: Web

edit comments in front end

I build my custom comments template. And i realised tht edit comment is being done in back-end ( dashbord). Is there any way to enable edit comments in the front-end instead of in admin menu? Would be possible to use the same form as i used for new comment?
Category: Web

Comment section not appearing on posts

My comment section simply does not appear on posts, even though on my first couple test posts, it did appear. The current theme I'm using is Tesseract, in case that is relevant. Before that I was using Urban Bold, which did not work out for me, despite having the comment section, initially. I have already tried out other themes too, and reverting back to Urban Bold just out of curiosity. They don't have the comment section either now. I have …
Category: Web

How to change Akismet commenter privacy notice?

I read the supposed explanation posted on their blog, and came away unenlightened. The following site-specific plugin does nothing (I have enabled it): <?php /* Plugin Name: Akismet Better Privacy Notice Description: Inform users about what's actually happening with their data */ apply_filters( 'akismet_comment_form_privacy_notice_markup', '<p class="akismet_comment_form_privacy_notice">' . 'Warning: This site uses Akismet to filter spam.' . ' Until or unless I can find a suitable replacement anti-spam solution, this means that' . ' (per their <a href="%s" target="_blank">indemnification document</a>)' . …
Category: Web

Actual comments not showing, but form is?

I have edited the comments form to remove a few fields and now the approved comments don't show up, just the form itself. What am I missing from this? <?php $comment_args = array( 'fields' => apply_filters( 'comment_form_default_fields', array( 'author' => '<p class="comment-form-author">' . '<label for="author">' . __( 'Name_' ) . '</label> ' . ( $req ? '<span class="required">*</span>' : '' ) . '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' />' . …
Category: Web

How to make comments private for commentor and post author

I am trying to make comments private. I mean comment must be visible for post author and comment author. I create custom comment section "better-comment.php". I have used pre_get_comments but I can not make work. Please help <?php // My custom comments output html function better_comments( $comment, $args, $depth ) { // Get correct tag used for the comments if ( 'div' === $args['style'] ) { $tag = 'div'; $add_below = 'comment'; } else { $tag = 'li'; $add_below = …
Category: Web

Comment Walker vs. Comment Callback

I've been messing around with custom comments this week and I'm trying to figure out when I'd want to use a walker and when I'd use a callback... There's some things I can't quite figure out how to change, but the one that's been driving me mad is how to add classes to the children <ul> tag: <ul class="children"> Are there certain things a comment walker can do that a comment callback can't?... or vice-versa? And is one of these …
Category: Web

Changing the Comment Fields using Filter (without success)

Am I doing this all wrong or should this be working? No matter what post I visit, it's thrown into an endless loop.. This is the code: add_filter('comment_form_fields', 'comment_form_args'); function comment_form_args( $fields ) { if ( ! is_user_logged_in() ) { comment_form(array( 'label_submit' => __('Submit for Approval'), 'comment_notes_before' => '', 'title_reply' => 'Need to ask something? Go ahead.', 'title_reply_to' => 'Your reply to %s', 'comment_field' => '<p class="comment-form-comment"><label for="comment">' . _x( '', 'noun' ) . '</label><br /><textarea id="comment" name="comment" aria-required="true"></textarea></p>', 'comment_notes_after' …
Category: Web

Name of comment field differs on different sites

I have a question regarding the „name“ of the comment field of wordpress blogs. I have 2 sites, that are just available locally on my LAN. On the first site, if I inspect the comment field in firefox, I see: <textarea id="comment" name="comment" cols="45" rows="8" maxlength="65525" required="required"></textarea> On the second site I see: <textarea autocomplete="new-password" id="comment" name="i817ab2c85" cols="45" rows="8" maxlength="65525" required="required" spellcheck="false"></textarea> Can anybody tell me, why the name of the comment field differs on the second site? Both sites …
Category: Web

How to send add_comment_meta value from separate file to main plugin file?

I try to add meta key and meta value to comment using add_action 'comment_post' and add_comment_meta. It works only in main plugin file but not in template file. So my first question: is it possible to use add_action 'comment_post' in seaparate plugin file? If it's not my second question how to send meta value from separate file? Main file code: add_action( 'comment_post', 'add_comment_post_type' ); function add_comment_post_type( $comment_ID ) { if ( ( isset( $_POST['meta_post_type_value'] ) ) && ( $_POST['meta_post_type_value'] !== …
Category: Web

COMMENT FORM Error: Please type your comment text

Error: Please type your comment text. I Created COMMENT FORM but Error happened which is above. I dont know hot to fix this Anyone help me please Thank you very much! Function.php /** コメント一覧表示部分のコード(CHAPTER 19)*/ function my_comment_list( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; ?> <li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>"> <div class="clearfix"> <div class="comment-author clearfix"> <?php echo get_avatar( $comment->comment_author_email, 65 ); ?> <p class="comment-author-name"><?php comment_author_link(); ?><span class="says">says:</span></p> <p class="comment-meta"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ) ?>"><?php …
Category: Web

Does WordPress Allow Blank/Empty Comment Submissions In WordPress?

I've got a great Comment Form and Threaded Comments setup by using the native WordPress functions: comment_form and wp_list_comments. However, I'm trying to also create a custom Contest Comment template for certain posts. I call comments_template('/contest-comments.php', true); conditionally based on whether a certain custom field exists or not. It works great. I'm trying to make it look along the lines of http://2010.sf.wordcamp.org/attendees/ I only want to show the person's name wrapped in a link and their avatar. Therefore, I want …
Category: Web

Cannot Remove Title Reply from Custom Comment Template for Signup Page

Building a page template, I've managed to remove all the fields I do not need. All except for the title reply and "your email will not be published..." text. The general idea here is to use a custom version of the comment form where users can sign-up. The actual comments (emails) will not be shown on the page unless logged in as admin. Code for the signup template: <?php if (post_password_required()) return; $signup_args = array( 'label_submit' => __('Sign Up', 'theme') …
Category: Web

How do I make the comment disappear after deleting from the database?

I can delete the comment from the database with this code, however when the page is loaded again the comment will still be there. I need to update again to disappear. How do I resolve this? <?php if( 'POST' == $_SERVER['REQUEST_METHOD'] ) { set_query_var( 'commentid1', $_POST['commentid'] ); wp_delete_comment( get_query_var( 'commentid1'), true ); }; ?> <form class="delete-comment" action="" method="post"> <input type="hidden" name="commentid" value="<?php comment_ID() ?>" /> <p align="right"> <input type="submit" value="Delete" title="Delete" /> </p> </form>
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.