Comments form improvements

This commit is contained in:
2018-12-11 11:09:44 +00:00
parent bc0e10dee5
commit 0d4dc29741
6 changed files with 84 additions and 7 deletions

View File

@@ -1,3 +1,18 @@
<?php
$form_settings = array(
class_form => 'comment-respond__form',
class_submit => 'comment-respond__submit',
comment_field => '<label class="comment-respond__label" for="comment">Comment</label><textarea class="comment-respond__input" id="comment" name="comment" cols="25" rows="8" aria-required="true"></textarea></p>',
logged_in_as => '<p class="comment-respond__text">' . sprintf( __( 'Logged in as <a class="link" href="%1$s">%2$s</a>. <a class="link" href="%3$s" title="Log out of this account">Log out?</a>' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( ) ) ) ) . '</p>',
title_reply_before => '<h3 id="reply-title" class="comment-respond__title">',
comment_notes_before => '<p class="comment-respond__notes">' . __( 'Your email address will not be published.' ) . ( $req ? $required_text : '' ) . '</p>',
fields => array(
author => '<div class="comment-respond__item"><label class="comment-respond__label" for="author">' . __( 'Name', 'domainreference' ) . ( $req ? '<span class="comment-respond__required">*</span>' : '' ) . '</label>' . '<input class="comment-respond__input" id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' /></div>',
email => '<div class="comment-respond__item"><label class="comment-respond__label" for="email">' . __( 'Email', 'domainreference' ) . ( $req ? '<span class="comment-respond__required">*</span>' : '' ) . '</label>' . '<input class="comment-respond__input id="email" name="email" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' /></div>',
url => '<div class="comment-respond__item"><label class="comment-respond__label" for="url">' . __( 'Website', 'domainreference' ) . '</label>' . '<input class="comment-respond__input" id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" /></div>',
),
);
?>
<div class="comments" id="comments">
<div class="comments__head">
<h2 class="comments__title">
@@ -27,8 +42,6 @@
</ol>
</div>
<div class="comments__foot">
<?php comment_form(array(
'class_form' => 'foo-bar'
)) ?>
<?php comment_form($form_settings) ?>
</div>
</div>

View File

@@ -26,9 +26,6 @@
</section>
<section class="page__metadata<?php echo ($index === 1 ? ' is-first' : '') ?>">
<?php get_template_part('partials/metadata') ?>
<div class="page__advert">
<?php get_template_part('partials/ad_wide_skyscraper') ?>
</div>
</section>
<?php endwhile; ?>
<section class="page__banner">