Fix: Use <h2> for comments title and form to improve a11y & SEO (#416)

This commit is contained in:
Rami Yushuvaev 2024-07-24 06:09:06 -07:00 committed by GitHub
parent 973dd46b64
commit f046b3acb0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 5 deletions

View file

@ -25,7 +25,7 @@ if ( comments_open() && get_option( 'thread_comments' ) ) {
<section id="comments" class="comments-area">

<?php if ( have_comments() ) : ?>
<h3 class="title-comments">
<h2 class="title-comments">
<?php
$comments_number = get_comments_number();
if ( '1' === $comments_number ) {
@ -46,7 +46,7 @@ if ( comments_open() && get_option( 'thread_comments' ) ) {
);
}
?>
</h3>
</h2>

<?php the_comments_navigation(); ?>

@ -69,8 +69,8 @@ if ( comments_open() && get_option( 'thread_comments' ) ) {
<?php
comment_form(
[
'title_reply_before' => '<h3 id="reply-title" class="comment-reply-title">',
'title_reply_after' => '</h3>',
'title_reply_before' => '<h2 id="reply-title" class="comment-reply-title">',
'title_reply_after' => '</h2>',
]
);
?>

View file

@ -36,6 +36,9 @@ Source: https://stocksnap.io/photo/4B83RD7BV9

== Changelog ==

= 3.1.1 - 2024-07-xx =
* Fix: Use consistent `<h2>` for comments title and comment form

= 3.1.0 - 2024-06-19 =
* Tweak: Update `Requires PHP 7.4`
* Tweak: Update `Tested up to 6.5`
@ -49,7 +52,7 @@ Source: https://stocksnap.io/photo/4B83RD7BV9
* Fix: Single post renders redundant wrapping `<div>` when it has no tags
* Fix: Remove redundant wrapping `<div>` from `wp_nav_menu()` output
* Fix: Wrap page `<h1>` with `<div>`, not `<header>`
* Fix: Uses consistent `<h3>` for comments title and comment form
* Fix: Use consistent `<h3>` for comments title and comment form
* Fix: Remove heading tags from dynamic header/footer
* Fix: Mobile Menu hamburger is not visible for logged-out users in some cases ([#369](https://github.com/elementor/hello-theme/issues/369))
* Fix: Remove duplicate ID attributes in the header mobile menu