Fix layout for single article images and style comments section

This commit is contained in:
Adolfo Reyna
2026-03-13 00:18:20 -04:00
parent a705a2a33e
commit 78a94fb2d2
3 changed files with 146 additions and 56 deletions

View File

@@ -3,26 +3,26 @@
* The template for displaying comments
*/
if ( post_password_required() ) {
if (post_password_required()) {
return;
}
?>
<div id="comments" class="comments-area reading-container">
<?php if ( have_comments() ) : ?>
<?php if (have_comments()): ?>
<h2 class="comments-title">
<?php
$comment_count = get_comments_number();
if ( '1' === $comment_count ) {
if ('1' === $comment_count) {
printf(
esc_html__( 'One thought on &ldquo;%1$s&rdquo;', 'wisdom1' ),
esc_html__('One thought on &ldquo;%1$s&rdquo;', 'wisdom1'),
'<span>' . get_the_title() . '</span>'
);
} else {
printf(
esc_html( _nx( '%1$s thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', $comment_count, 'comments title', 'wisdom1' ) ),
number_format_i18n( $comment_count ),
esc_html(_nx('%1$s thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', $comment_count, 'comments title', 'wisdom1')),
number_format_i18n($comment_count),
'<span>' . get_the_title() . '</span>'
);
}
@@ -33,7 +33,7 @@ if ( post_password_required() ) {
<?php
wp_list_comments(
array(
'style' => 'ol',
'style' => 'ol',
'short_ping' => true,
'avatar_size' => 60,
)
@@ -45,20 +45,22 @@ if ( post_password_required() ) {
the_comments_navigation();
// If comments are closed and there are comments, let's leave a little note, shall we?
if ( ! comments_open() ) :
if (!comments_open()):
?>
<p class="no-comments"><?php esc_html__( 'Comments are closed.', 'wisdom1' ); ?></p>
<p class="no-comments"><?php esc_html__('Comments are closed.', 'wisdom1'); ?></p>
<?php
endif;
endif; // Check for have_comments().
comment_form(
array(
'title_reply_before' => '<h2 id="reply-title" class="comment-reply-title">',
'title_reply_after' => '</h2>',
)
$args = array(
'class_form' => 'comment-form mt-4 p-4 rounded bg-white shadow-sm border',
'class_submit' => 'btn btn-secondary fw-bold text-uppercase mt-3',
'title_reply_before' => '<h2 id="reply-title" class="comment-reply-title h3 font-serif mb-4">',
'title_reply_after' => '</h2>',
'comment_field' => '<div class="comment-form-comment mb-3"><label for="comment" class="form-label fw-bold">Your Perspective <span class="text-danger">*</span></label><textarea id="comment" name="comment" cols="45" rows="6" maxlength="65525" required="required" class="form-control bg-light"></textarea></div>',
);
comment_form($args);
?>
</div><!-- #comments -->
</div><!-- #comments -->