WordPress_MxDev/comments.php
2025-08-18 17:56:26 -04:00

34 lines
967 B
PHP

<?php
function my_custom_comment_format($comment, $args, $depth)
{
$GLOBALS['comment'] = $comment; ?>
<article class="comment">
<h2><?php comment_author(); ?>
</h2>
<br>
<h3><?php printf(__('%1$s at %2$s'), get_comment_date(), get_comment_time()); ?></h3>
<?php comment_text(); ?>
</article>
<?php
}
?>
<div id="comments" class="comments-area">
<?php if (have_comments()): ?>
<?php
wp_list_comments(array(
'callback' => 'my_custom_comment_format',
));
?>
<?php endif; ?>
<?php if (!comments_open() && get_comments_number() && post_type_supports(get_post_type(), 'comments')): ?>
<p class="no-comments"><?php esc_html_e('Comments are closed.', 'your-theme'); ?></p>
<?php endif; ?>
<?php comment_form(); ?>
</div>