-
Notifications
You must be signed in to change notification settings - Fork 860
Comments template cleaned up and refactored #1296
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,6 @@ | |
*/ | ||
|
||
if ( have_comments() ) : | ||
if ( ( is_page() || is_single() ) && ( ! is_home() && ! is_front_page() ) ) : | ||
?> | ||
<section id="comments"> | ||
<?php | ||
|
@@ -37,9 +36,11 @@ | |
); | ||
|
||
?> | ||
<?php | ||
the_comments_pagination(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would prefer if we implemented Foundation pagination styles using custom SCSS classes here. Can this be done with that function? Or do we need to fix There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are right. I will update the pull request. I will replace the |
||
?> | ||
</section> | ||
<?php | ||
endif; | ||
endif; | ||
?> | ||
|
||
|
@@ -65,96 +66,12 @@ | |
|
||
<?php | ||
if ( comments_open() ) : | ||
if ( ( is_page() || is_single() ) && ( ! is_home() && ! is_front_page() ) ) : | ||
?> | ||
<hr> | ||
<section id="respond"> | ||
<h3> | ||
<?php | ||
comment_form_title( | ||
__( 'Leave a Reply', 'foundationpress' ), | ||
/* translators: %s: author of comment being replied to */ | ||
__( 'Leave a Reply to %s', 'foundationpress' ) | ||
); | ||
?> | ||
</h3> | ||
<p class="cancel-comment-reply"><?php cancel_comment_reply_link(); ?></p> | ||
<?php if ( get_option( 'comment_registration' ) && ! is_user_logged_in() ) : ?> | ||
<p> | ||
<?php | ||
/* translators: %s: login url */ | ||
printf( | ||
__( 'You must be <a href="%s">logged in</a> to post a comment.', 'foundationpress' ), | ||
wp_login_url( get_permalink() ) | ||
); | ||
?> | ||
</p> | ||
<?php else : ?> | ||
<form action="<?php echo get_option( 'siteurl' ); ?>/wp-comments-post.php" method="post" id="commentform"> | ||
<?php if ( is_user_logged_in() ) : ?> | ||
<p> | ||
<?php | ||
/* translators: %1$s: site url, %2$s: user identity */ | ||
printf( | ||
__( 'Logged in as <a href="%1$s/wp-admin/profile.php">%2$s</a>.', 'foundationpress' ), | ||
get_option( 'siteurl' ), | ||
$user_identity | ||
); | ||
?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php __( 'Log out of this account', 'foundationpress' ); ?>"><?php _e( 'Log out »', 'foundationpress' ); ?></a> | ||
</p> | ||
<?php else : ?> | ||
<p> | ||
<label for="author"> | ||
<?php | ||
_e( 'Name', 'foundationpress' ); | ||
if ( $req ) { | ||
_e( ' (required)', 'foundationpress' ); | ||
} | ||
?> | ||
</label> | ||
<input type="text" class="five" name="author" id="author" value="<?php echo esc_attr( $comment_author ); ?>" size="22" tabindex="1" <?php if ( $req ) { echo "aria-required='true'"; } ?>> | ||
</p> | ||
<p> | ||
<label for="email"> | ||
<?php | ||
_e( 'Email (will not be published)', 'foundationpress' ); | ||
if ( $req ) { | ||
_e( ' (required)', 'foundationpress' ); | ||
} | ||
?> | ||
</label> | ||
<input type="text" class="five" name="email" id="email" value="<?php echo esc_attr( $comment_author_email ); ?>" size="22" tabindex="2" <?php if ( $req ) { echo "aria-required='true'"; } ?>> | ||
</p> | ||
<p> | ||
<label for="url"> | ||
<?php | ||
_e( 'Website', 'foundationpress' ); | ||
?> | ||
</label> | ||
<input type="text" class="five" name="url" id="url" value="<?php echo esc_attr( $comment_author_url ); ?>" size="22" tabindex="3"> | ||
</p> | ||
<?php endif; ?> | ||
<p> | ||
<label for="comment"> | ||
<?php | ||
_e( 'Comment', 'foundationpress' ); | ||
?> | ||
</label> | ||
<textarea name="comment" id="comment" tabindex="4"></textarea> | ||
</p> | ||
<p id="allowed_tags" class="small"><strong>XHTML:</strong> | ||
<?php | ||
_e( 'You can use these tags:', 'foundationpress' ); | ||
?> | ||
<code> | ||
<?php echo allowed_tags(); ?> | ||
</code> | ||
</p> | ||
<p><input name="submit" class="button" type="submit" id="submit" tabindex="5" value="<?php esc_attr_e( 'Submit Comment', 'foundationpress' ); ?>"></p> | ||
<?php comment_id_fields(); ?> | ||
<?php do_action( 'comment_form', $post->ID ); ?> | ||
</form> | ||
<?php endif; // If registration required and not logged in. ?> | ||
<?php comment_form(array( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please format like this: <?php
comment_form(
array(
'class_submit' => 'button'
)
);
?> There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I updated the pull request |
||
'class_submit' => 'button' | ||
)); ?> | ||
</section> | ||
<?php | ||
endif; // If you delete this the sky will fall on your head. | ||
endif; // If you delete this the sky will fall on your head. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add an
<hr>
here? I think it makes the the comments section easier to decipher from the post content with one.EDIT: So it's clear, I'm talking right before the
<section>
element.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a good idea but also we still could add a line with CSS and border, which will avoid adding hr element...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are already using an
<hr>
element between the comments and the leave a reply form.Questions for everybody:
<hr>
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would either remove the
<hr>
in both places or just add the<hr>
element. I lean towards being less opinionated when it comes to design.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the
<hr>
from the pull request