Articles of comments

customize comment form

I want to change the titles “Name”, “Email”, and “Website” in my comment form?. How could I do this? I thought by changing them in this field would work ( ‘Website’, ‘domainreference’ ) but it doesn’t change anything. Any help would be appreciated. Here is my comments.php <?php if ( have_comments() ) : ?> <h4 […]

How to Orderby Comments by post title?

Whatever I tried so far didn’t work. So I started looking everywhere for a few days now, trying to figure out how to order comments by the title of the post they are made into. (I tried a meta_value also, but it seems I didn’t do it right). I read the wp codex. Here is […]

Comment Follow-Up Notifier?

Hey guys. Is there a plugin out there that can easily notify a user of a follow up reply to their comment? I used to use subscribe to comments but it hasn’t been updated since 2007. Also, I think I remember being the ‘unsubscribe’ process to be pretty tedious or confusing. I would like it […]

How to query comments only for the current post?

I am using ACF and my comments have custom fields. I also have custom post type called cars. What I’m trying to do is to make users comment their average consumption, and then I calculate average consumption for single car. I did that, and it works well except one part. Average consumption is same for […]

WordPress – different icon image depends of comment number

I would like to add different icon depends of comments number. For example post has 10 comments and it has standard icon. When post has more than 10 comments (it’s hot topic) it has different icon. Any clue how to do that? Edit: I created div with custom icon picture (png) next to the comments […]

Get the top level comment ID

How do I get the ID of the top level comment, as in, the top parent comment? Useful functions like get_ancestors() and get_post_ancestors() don’t work with comments.

How would I add the comment count to this sub-pages of current page snippet

I have this snippet <ul> <?php global $id; wp_list_pages( array( ‘title_li’ => ”, ‘depth’ => 1, ‘child_of’ => $id, ‘sort_column’ => ‘post_title’, ‘show_date’ => ‘modified’, ‘date_format’ => $date_format ) ); ?> </ul> But how would I add this… <?php comments_number( ‘no responses’, ‘one response’, ‘% responses’ ); ?> So the number of comments are displayed […]

Auto delete comment if Contains

How to Auto-Delete comment if contains certain string? i tried with this but not work: add_action( ‘transition_comment_status’, ‘my_approve_comment_callback’, 10, 3 ); function my_approve_comment_callback( $new_status, $old_status, $comment ) { if (strpos($comment->comment_content, ‘dog’) !== false) { wp_delete_comment( $comment->comment_ID, true ); } } I have also tried with: wp_list_comments(‘callback=better_comment’); function better_comment($comment, $args, $depth) { if (strpos($comment->comment_content, ‘dog’) !== […]

human_time_diff() returns “48 years ago” for all comments

Trying to make a custom comments box. When I go to display the time when the comment was post (ie, 2 days ago, 3 hours ago, etc.) I get the same for every comment on every post: “48 Years” $args = array( ‘number’ => ‘4’, ‘post_id’ => $id, // use post_id, not post_ID ); $comments […]

Create comments.php form of custom HTML code

One example of the comments.php is available here. I have created comments.php file in my theme folder. In my content.php my HTML for displaying comment form looks like this: <textarea name=”name” rows=”8″ cols=”80″></textarea> <div class=”t-comment-section”> <p>Full Name:</p> <input type=”text” name=”Full Name”> <p>Email:</p> <input type=”text” name=”Email address”> <p>Website:</p> <input type=”text” name=”Website url”> <a href=””><i class=”fa fa-comment” […]