Skip to main content
just improved the formatting for skim-readers
Source Link
Josh C
  • 273
  • 3
  • 9

There are obviously a number of ways to accomplish this. For example, to move the comment field to the bottom of the form you would use code like this:

add_filter( 'comment_form_fields', 'move_comment_field' );
function move_comment_field( $fields ) {
    $comment_field = $fields['comment'];
    unset( $fields['comment'] );
    $fields['comment'] = $comment_field;
    return $fields;
}

If you wanted to rearrange all the fields, unset all the fields. Put them back into the array in the order you want them displayed. Simple right?rearrange all the fields:

  1. unset all the fields
  2. put the fields back into the array but in the order you want them displayed

Simple right? I figured I'd spell it out explicitly for the next noobie like me to find this page and not find the answers useful.

There are obviously a number of ways to accomplish this. For example, to move the comment field to the bottom of the form you would use code like this:

add_filter( 'comment_form_fields', 'move_comment_field' );
function move_comment_field( $fields ) {
    $comment_field = $fields['comment'];
    unset( $fields['comment'] );
    $fields['comment'] = $comment_field;
    return $fields;
}

If you wanted to rearrange all the fields, unset all the fields. Put them back into the array in the order you want them displayed. Simple right?

I figured I'd spell it out explicitly for the next noobie like me to find this page and not find the answers useful.

There are obviously a number of ways to accomplish this. For example, to move the comment field to the bottom of the form you would use code like this:

add_filter( 'comment_form_fields', 'move_comment_field' );
function move_comment_field( $fields ) {
    $comment_field = $fields['comment'];
    unset( $fields['comment'] );
    $fields['comment'] = $comment_field;
    return $fields;
}

If you wanted to rearrange all the fields:

  1. unset all the fields
  2. put the fields back into the array but in the order you want them displayed

Simple right? I figured I'd spell it out explicitly for the next noobie like me to find this page and not find the answers useful.

Source Link
Josh C
  • 273
  • 3
  • 9

There are obviously a number of ways to accomplish this. For example, to move the comment field to the bottom of the form you would use code like this:

add_filter( 'comment_form_fields', 'move_comment_field' );
function move_comment_field( $fields ) {
    $comment_field = $fields['comment'];
    unset( $fields['comment'] );
    $fields['comment'] = $comment_field;
    return $fields;
}

If you wanted to rearrange all the fields, unset all the fields. Put them back into the array in the order you want them displayed. Simple right?

I figured I'd spell it out explicitly for the next noobie like me to find this page and not find the answers useful.