Tag Info

New answers tagged

0

By using comment_form( $args, $post_id ) you can add extra field in your comment form like this $commenter = wp_get_current_commenter(); $req = get_option( 'require_name_email' ); $aria_req = ( $req ? " aria-required='true'" : '' ); $fields = array( 'author' => '<p class="comment-form-author">' . '<label for="author">' . __( 'Name' ) . ...


0

You can get the title of a post if you have the post ID and every comment is assigned to a post ID. So basically, just use the comment_post_ID + get_the_title() function: get_the_title($c->comment_post_ID);


1

Try this Solution.This will surely helps you. Replace your wp-includes and wp-admin folder with WordPress's core folder from WordPress package. May be you have problem with uploading these two folders and this may lead you that problem.


0

// Disable support for comments and trackbacks in post types function df_disable_comments_post_types_support() { $post_types = get_post_types(); foreach ($post_types as $post_type) { if(post_type_supports($post_type, 'comments')) { remove_post_type_support($post_type, 'comments'); remove_post_type_support($post_type, ...


3

Try this: if( get_comment_author() == get_comment_author_link() ) echo get_avatar( $comment, $size='75' ); else echo '<a href="' . get_comment_author_url . '">' . get_avatar( $comment, $size='75' ) . '</a>';


0

My bad. Should have added a foreach for the replies as well. <?php $args = array( 'user_id' => $curauth->ID, 'number' => 5, 'status' => 'approve', 'parent' => 0 ); $comments = get_comments($args); if ( $comments ) { foreach($comments as $c){ echo '<ul ...


0

Answering my own question - I'm not 100% sure this is safe, but I'm using supplied before/after actions to put in a before/after div like so: //for the comment wrapping functions - ensures HTML does not break. $comment_open_div = 0; /** * Creates an opening div for a bootstrap row. * @global int $comment_open_div */ function _lp_before_comment_fields(){ ...


5

You can try to modify it with the comment_form_defaults filter: /** * Modify the "must_log_in" string of the comment form. * * @see http://wordpress.stackexchange.com/a/170492/26350 */ add_filter( 'comment_form_defaults', function( $fields ) { $fields['must_log_in'] = sprintf( __( '<p class="must-log-in"> You must ...


3

You should consider hooking into the comment_class() and post_class() filters, if your theme supports it. Using the comment_class filter: We can add the following filter: /** * Add a custom comment class, based on a given comment author's user meta field. * * @see http://wordpress.stackexchange.com/a/170443/26350 */ add_filter( 'comment_class', ...


1

Easiest way to handle hiding the display is to use css. Your "reply to" form is probably displayed inside of a comment div or has some class identifying it as a comment reply. You still might need to handle the check on the server side to make the rating field to be not required when a comment has a parent comment.


3

The comment_notification_text filter is in wp-includes/pluggable.php in the wp_notify_postauthor function. You can copy and paste the $notify_message stuff and edit out what you don't want. function wpd_comment_notification_text( $notify_message, $comment_id ){ // get the current comment and post data $comment = get_comment( $comment_id ); $post ...


3

There is no need for a plugin. The reason people get this confused is because posts can have comments enabled or disabled on an individual basis. There is no "global" option, because it's per post. So really, it just takes two main steps to disable comments in WordPress: Settings > Discussion. Turn off both "Allow link notifications from other blogs ...


0

Upon your question, I think you want to totally disable comment from your website. There are few ways to do it.... 1. You can disable comment in your WordPress settings here... Settings >> Discussion >> uncheck "Allow people to post comments on new articles" 2. You can use some plugins to do it like https://wordpress.org/plugins/disable-comments/ 3. ...


0

The answer is that you can't do it without using comments.php. Since WordPress 2.7, comments.php is important to display full features and customizable comments rest if you still want to use <?php comments_template(); ?> then you can edit anything in it except CSS.


0

I'm afraid this is the problem: Wrong: <?php if ( $depth + 1) { ?> Correct: <?php if ( $depth > 1) { ?> That is what I think...


2

parent : Comments can be replies to other comments. Every comment has an ID number. When the comment is a reply, then it will have a "parent" which is the ID of the comment it is replying to. Putting a comment ID in here will get all the replies to that comment. post_parent : Posts can be children of other posts as well. This is how things like hierarchical ...


2

The wp_list_comments() function uses the HTML comment list class Walker_Comment by default: A single comment is then displayed with the Walker_Comment::comment() method (#source). If the comment format is HTML5 then the Walker_Comment::html5_comment() is used instead (#source). The pingbacks are rendered with the Walker_Comment::ping() method (#source). ...



Top 50 recent answers are included