How to put the author of the post in the comments?

Not sure it’s the shortest way, but it works) Get post author id $post_author_id = get_post_field( ‘post_author’, $c->comment_post_ID ); Get author data by id $post_author_display_name = get_the_author_meta( ‘display_name’, $post_author_id ); Try this shorter version $output.= get_the_author_meta( ‘display_name’, get_post_field( ‘post_author’, $c->comment_post_ID ) ); Check documentation page which data is available with get_the_author_meta()

How to create a classified section in place of comments_template

It will be a three step process. You can use comment_form_logged_in_after (for logged in users) and/or comment_form_after_fields (for non-logged in users) actions to add your custom fields. Save the values as comment meta using update_comment_meta function hooked into comment_post action. Get the values using get_comment_meta. EDIT: 25-05-2022 Try this.. /* * This will add the … Read more

I don’t have comments.php… how do I customize my comment fields

A little late, but you could also add the following to your theme’s functions.php file: /** Comment Form Function Defaults */ add_filter(‘comment_form_defaults’,’my_comment_defaults’); function my_comment_defaults($defaults) { global $user_identity, $id; if ( isset($post_id) ) $id = $post_id; else $post_id = $id; $commenter = wp_get_current_commenter(); $req = get_option( ‘require_name_email’ ); $aria_req = ( $req ? ” aria-required=’true'” : … Read more