Parent comment’s author display_name

So to do the same thing but for the parent comment this should do it. This is untested but does the same thing as your first case, but with the parent comment object instead of the current comment. if( $comment->comment_parent ) { $parentComment = get_comment($comment->parent); $usermeta = get_userdata($parentComment->user_id); echo $usermeta->display_name ; } Does that do … Read more

Upload avatar for post comment

WordPress doesn’t have built-in profile pictures (Avatars) by default. See Settings > Discussion in the menu for available options. So you may have a few options: Use Gravatar, as this is bundled in WordPress by default and free but would not require a profile image upload button as its managed separately. Look for an Avatar … Read more

Same comment section on every page

With some testing this appears to be achievable with two filters. Firstly you want to set front end queries for comments to query for comments for all posts, instead of just the current post. That can be done like this: add_action( ‘pre_get_comments’, function( $comment_query ) { if ( ! is_admin() ) { $comment_query->query_vars[‘post_id’] = 0; … Read more

Get all comments associated with a specific page ID (comment_post_ID)

Based on developer documents of get_comments functions, it is using args like WP_Comment_Query::__construct Method which is accepts post_id in the argument’s array. So, the code will be like: foreach($assignments as $assignment) { echo $assignment->post_title; $args = array( ‘number’ => 0, ‘status’ => ‘approve’, // shows all comments, but it shouldn’t ‘post_id’ => $assignment->ID ); $comments … Read more

Display date and time into post edit comments section

Here is the answer given by Ferman on wpfr.net function date_commentaire( ){ $comments = get_comments( array( ‘post_id’ => get_the_ID() )); if ( doing_action( ‘wp_ajax_get-comments’ ) ) foreach ( $comments as $comment ) : $a = $comment->comment_ID; $b = get_comment_ID(); $date_comment = get_comment_date(); $time_comment = get_comment_time(); if ( $a==$b ) echo ‘<p class=”commentaire-date”>’.’Commentaire N°: ‘.$comment->comment_ID.’ du: … Read more

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