How to change the order of elements in comment_form()

I’ve put the class for ‘logged_in_as’ into another container to display the content in another column:

    <div id="content-form">

       <?php 

         $fields =  array(

            'author' => '<div class="right_col"><p class="comment-form-author">
                            <input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' /></p>',
            'email'  => '<p class="comment-form-email">
                            <input id="email" name="email" type="text" value="Name' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' /></p>',
            'url'    => '<p class="comment-form-url">
                            <input id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" /></p></div>',
        );  

        comment_form( array(

           'label_submit' => 'Beitrag kommentieren', 
           'title_reply' => '', 
           'fields' => apply_filters( 
              'comment_form_default_fields', $fields ), 
           'comment_notes_before' => '', 
           'comment_notes_after' => '',
           'logged_in_as' => '<div class="right_col"><p class="logged-in-as">' 
                                . sprintf( 
                                      __( 'Logged in as <a href="https://wordpress.stackexchange.com/questions/63247/%s">%s</a> . 
                                           <a href="https://wordpress.stackexchange.com/questions/63247/%s" title="Log out of this account">Log out?</a></p></div>' 
                                      )
                                      , admin_url( 'profile.php' )
                                      , $user_identity
                                      , wp_logout_url( apply_filters( 'the_permalink'
                                                                      , get_permalink( $post_id ) 
                                                                     ) 
                                                      ) 
                                  )

       ?>


    </div>

But the submit-button for the comment-field (which is in the left column) only displays after the content of ‘logged_in_as’.
screenshot of the comment-form

But I want to place the submit-button on the left side below the comment-field. How can I place the Submit-Button before the ‘logged_in_as’-Content?

2 Answers
2

You don’t change the ordering, essentially. If you need to reposition things on the page, you should use CSS. That’s what it’s for.

The submit button is in a P with a class of form-submit. You can use that to move it around with CSS.

Leave a Comment