How to Move Comment Text Field to Bottom

Hello Guys. Hope You Guys Are Safe In Your Home. So I Am Here With A New Episode Which Is Very Important For All WordPress Guys. By Default WordPress Comment Text Field Is In Top. Today’s Modern Designer May Put That Comment Field Bottom Or They Design The Comment Area As They Want. We Need To Make The WordPress Comment Field Like The Design. We Need To Make Those Field Up And Down. So Today I am Going To Show You Guys How You Can Change The Position Of Those Field.

By Default WordPress Comment Field Is Like The Screenshot. It Is twentytwenty WordPress Theme Comment Field.

How to Move Comment Text Field to Bottom

By Default You Will Get The Comment Field Like IT. So What You Need To Do Is Just Copy The Code Below And Paste That In Your Theme funstions.php.

Move Comment Box

//Comment Textarea Change Position
function themehat_move_comment_field_to_bottom( $fields ) {
    $comment_field = $fields['comment'];
    unset( $fields['comment'] );
    $fields['comment'] = $comment_field;
    return $fields;
}
add_filter( 'comment_form_fields', 'themehat_move_comment_field_to_bottom' );

WordPress Give Us A Filter Which Name Is comment_form_fields. For Knowing More About add_filter Click Here. Inside That Filter We Need A Callback Function Which Is themehat_move_comment_field_to_bottom. On That Callback function We Set A argument which Is $fields. Now We Need To unset The Comment Field. Then Just return $fields. You Will See That Like The Screenshot.

How to Move Comment Text Field to Bottom

Move Comment Box And Cookies

Oh No What Happened? I Don’t Want Like This. I Need cookies Field Down Of Comment Field. Ok No Tension I Will Show That Also. Just Do Like As I Do. Its The Full Code.

//Comment Textarea Change Position
function themehat_move_comment_field_to_bottom( $fields ) {
    $comment_field  = $fields['comment'];
    $cookie         = $fields['cookies'];
    unset( $fields['comment'] );
    unset( $fields['cookies'] );
    $fields['comment'] = $comment_field;
    $fields['cookies'] = $cookie;
    return $fields;
}
add_filter( 'comment_form_fields', 'themehat_move_comment_field_to_bottom' );
How to Move Comment Text Field to Bottom

Hurray We have Done It. Happy Coding. For More Go Here

Shopping Cart