Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the heading H3 to H2 of 'Leave a Reply’, accessibility #117

Closed
CarlosLongarela opened this issue Aug 20, 2020 · 9 comments
Closed

Comments

@CarlosLongarela
Copy link

Hi @tomusborne, excellent work with GeneratePress, I love your Theme code, congrats.

Would to be possible to change the title of the comment from h3 to h2? If the post has only one h1 (and no h2), then, there is an accessibility problem with the comments h3.

Please, review this WP core thread https://core.trac.wordpress.org/ticket/36364

Thanks.

@diggeddy
Copy link
Collaborator

diggeddy commented Aug 20, 2020

Hi there,

you can use the comment_form_defaults filter:

https://developer.wordpress.org/reference/hooks/comment_form_defaults/

Heres an example:

https://generatepress.com/forums/topic/change-comments-h-class-or-add-additional-css-to-exclude-in-table-of-content/#post-1149141

If you need further assistance please raise a topic on our support forum

@CarlosLongarela
Copy link
Author

Hi there, thanks a lot for your quick response.

Yes, I know that I can change this H3 to H2 (I did it), but the correct option would be that this fantastic Theme incorporate Comments title as H2 by default because this is the correct SEO and accessibility option, it's the default option in Twenty Twenty or Underscores

Kindly regards.

@tomusborne
Copy link
Owner

Thanks for the heads up!

Just to make sure, are we talking about this element?: https://github.com/tomusborne/generatepress/blob/release/3.0.0/comments.php#L67

@CarlosLongarela
Copy link
Author

CarlosLongarela commented Aug 20, 2020

Yes, that's the correct H3 element.

Thanks ;)

@kamauwanjoroge
Copy link

would be that this fantastic Theme incorporate Comments title as H2 by default

I disagree with this one because it would affect a lot of users. Personally, my comment heading is an h4 and SEO-wise, it makes no difference what heading value you assign to comment titles. in fact, I have turned all my GP widget headings to <div> tags.

@CarlosLongarela
Copy link
Author

If your post has a title (h1) and only text content (without headings), then Leave Reply would be H3 and you'll have H1 -> H3, and H2 tag???

You could change it with comment_form_defaults but Theme default would be desirable to be an H2.

Please check:

@kamauwanjoroge
Copy link

@CarlosLongarela Try this code by @tomusborne and just change h3 to h2 https://wordpress.org/support/topic/function-to-change-comment-title-from-h3/#post-13372962. But you will need to wait for the GP version 3.0 or install the beta version here https://generatepress.com/generatepress-3-0-a-new-era/

Adding PHP https://docs.generatepress.com/article/adding-php/

@qx54
Copy link

qx54 commented Oct 2, 2020

would be that this fantastic Theme incorporate Comments title as H2 by default

I disagree with this one because it would affect a lot of users. Personally, my comment heading is an h4 and SEO-wise, it makes no difference what heading value you assign to comment titles. in fact, I have turned all my GP widget headings to <div> tags.

Agree, regarding SEO because it's part of the layout rather than content it should be a div, not a H3 or H4.

@tomusborne
Copy link
Owner

I think the filter (https://wordpress.org/support/topic/function-to-change-comment-title-from-h3/#post-13372962) is good enough here for now until there's a solid reason why it should be changed by default.

Thanks for the discussion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants