get_query_var(‘paged’) for WP_Comment_Query always return 1 when using paginate_comments_links()

I’m sure the problem is in this line of code, since it ALWAYS return 1: $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; Yes, that’s correct. And to retrieve the page number of the current comments page, where the URL contains the /comment-page-<number>, use get_query_var( ‘cpage’ ) and not get_query_var( ‘paged’ ), i.e. the query var … Read more

Rewrite comment form post ID on submit

This bit of code will update the comment_post_ID with the value submitted using your custom form. function wpse405448_update_comment( $comment_ID, $comment_approved, $commentdata ) { if ( isset($_POST[‘acf’][‘field_6278d64aecf19’]) && !empty($_POST[‘acf’][‘field_6278d64aecf19’]) ) { $comment_post_id = intval($_POST[‘acf’][‘field_6278d64aecf19’]); $com_arr = array( ‘comment_ID’ => $comment_ID, ‘comment_post_ID’ => $comment_post_id, ); wp_update_comment($com_arr); } } add_action( ‘comment_post’, ‘wpse405448_update_comment’, 10, 3 ); Make sure both … Read more

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