Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Comment form

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #149799
    gabbagabba
    Participant

    I need some help fixing a small problem. Using Comment Guestbook plugin.

    If you go to: http://www.vennetreff.no/for-medlemmer.

    The form on top of the right sidebar; I need the red title (“Skriv innlegg:”) to sit on top of the textfield. So that “logget in som admin” and “logg ut?” comes on top.

    In the wp-includes/comment-template.php I have this code:

    function comment_form( $args = array(), $post_id = null ) {
        if ( null === $post_id )
            $post_id = get_the_ID();
        else
            $id = $post_id;
    
        $commenter = wp_get_current_commenter();
        $user = wp_get_current_user();
        $user_identity = $user->exists() ? $user->display_name : '';
    
        if ( ! isset( $args['format'] ) )
            $args['format'] = current_theme_supports( 'html5', 'comment-form' ) ? 'html5' : 'xhtml';
    
        $req      = get_option( 'require_name_email' );
        $aria_req = ( $req ? " aria-required='true'" : '' );
        $html5    = 'html5' === $args['format'];
        $fields   =  array(
            'author' => '<p class="comment-form-author">' . '<label for="author">' . __( 'Name' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
                        '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' /></p>',
            'email'  => '<p class="comment-form-email"><label for="email">' . __( 'Email' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
                        '<input id="email" name="email" ' . ( $html5 ? 'type="email"' : 'type="text"' ) . ' value="' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' /></p>',
            'url'    => '<p class="comment-form-url"><label for="url">' . __( 'Website' ) . '</label> ' .
                        '<input id="url" name="url" ' . ( $html5 ? 'type="url"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" /></p>',);
        $required_text = sprintf( ' ' . __('Required fields are marked %s'), '<span class="required">*</span>' );
        $defaults = array(
            'fields'               => apply_filters( 'comment_form_default_fields', $fields ),
            'comment_field'        => '<p class="comment-form-comment"><textarea id="comment" name="comment" cols="45" rows="4" aria-required="true"></textarea></p>',
            'must_log_in'          => '<p class="must-log-in">' . sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',
            'logged_in_as'         => '<p class="logged-in-as">' . sprintf( __( 'Logget in som <a href="%1$s">%2$s</a>.<br /> <a href="%3$s" title="Log out of this account">Logg ut?</a>' ), get_edit_user_link(), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',
            'comment_notes_before' => '<p class="comment-notes">' . __( 'Your email address will not be published.' ) . ( $req ? $required_text : '' ) . '</p>',
            'comment_notes_after'  => '<p class="form-allowed-tags">' . sprintf( __( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: %s' ), ' <code>' . allowed_tags() . '</code>' ) . '</p>',
            'id_form'              => 'commentform',
            'id_submit'            => 'submit',
            'title_reply_to'       => __( 'Svar til: %s' ),
            'cancel_reply_link'    => __( 'Klikk for å avbryte' ),
            'title_reply'          => __( 'Skriv innlegg:' ),
            'label_submit'         => __( 'Send' ),
            'format'               => 'xhtml',
        );
    
        $args = wp_parse_args( $args, apply_filters( 'comment_form_defaults', $defaults ) );
    
        ?>
            <?php if ( comments_open( $post_id ) ) : ?>
                <?php do_action( 'comment_form_before' ); ?>
                <div id="respond" class="comment-respond">
                    <h3 id="reply-title" class="comment-reply-title"><?php comment_form_title( $args['title_reply'] ); ?></h3>
                    <?php cancel_comment_reply_link( $args['cancel_reply_link'] ); ?>
                    <?php if ( get_option( 'comment_registration' ) && !is_user_logged_in() ) : ?>
                        <?php echo $args['must_log_in']; ?>
                        <?php do_action( 'comment_form_must_log_in_after' ); ?>
                    <?php else : ?>
                        <form action="<?php echo site_url( '/wp-comments-post.php' ); ?>" method="post" id="<?php echo esc_attr( $args['id_form'] ); ?>" class="comment-form"<?php echo $html5 ? ' novalidate' : ''; ?>>
                            <?php do_action( 'comment_form_top' ); ?>
                            <?php if ( is_user_logged_in() ) : ?>
                                <?php echo apply_filters( 'comment_form_logged_in', $args['logged_in_as'], $commenter, $user_identity ); ?>
                                <?php do_action( 'comment_form_logged_in_after', $commenter, $user_identity ); ?>
                            <?php else : ?>
                                <?php echo $args['comment_notes_before']; ?>
                                <?php
                                do_action( 'comment_form_before_fields' );
                                foreach ( (array) $args['fields'] as $name => $field ) {
                                    echo apply_filters( "comment_form_field_{$name}", $field ) . "\n";
                                }
                                do_action( 'comment_form_after_fields' );
                                ?>
                            <?php endif; ?>
                            <?php echo apply_filters( 'comment_form_field_comment', $args['comment_field'] ); ?>
                            <?php echo $args['comment_notes_after']; ?>
                            <p class="form-submit">
                                <input name="submit" type="submit" id="<?php echo esc_attr( $args['id_submit'] ); ?>" value="<?php echo esc_attr( $args['label_submit'] ); ?>" />
                                <?php comment_id_fields( $post_id ); ?>
                            </p>
                            <?php do_action( 'comment_form', $post_id ); ?>
                        </form>
                    <?php endif; ?>
                </div><!-- #respond -->
                <?php do_action( 'comment_form_after' ); ?>
            <?php else : ?>
                <?php do_action( 'comment_form_comments_closed' ); ?>
            <?php endif; ?>
        <?php
    }
    

    I have tried to change the order of some, but haven’t succeeded yet…

Viewing 1 post (of 1 total)
  • The forum ‘Back End’ is closed to new topics and replies.