• I’m wondering if there is a straightforward way to change the formatting for the widget titles and author box to use a SPAN or DIV tag rather than H4. The H4 tags work, but they read as an HTML error in a lot of validation tools if there are no H3 elements on a page. Is there a way to do it short of replacing the code in a child theme?

    Thanks!

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Theme Author ronangelo

    (@ronangelo)

    Is there a way to do it short of replacing the code in a child theme?

    I don’t thinks so.

    Honestly though, if the only concern here is that various validation tools are not happy with it then I personally would just ignore those. The problem is that just like you mentioned there are a lot of validation tools out there with their own differing recommendations. The only ones I concern myself with is https://validator.w3.org/ or those by Google. Having said that, I haven’t really seen any Errors with an unedited Frontier theme, maybe just a couple of Warnings.

    Ron

    Thread Starter Ate Up With Motor

    (@ate-up-with-motor)

    The validation tool I’ve been using (the WAND browser extension by WebAIM) is based primarily on the WCAG standards, which I think WordPress is now requiring for core code. (I’m not a developer, so I’m not up on all that.)

    Since WAND is an automated tool, it has its limitations, but I think the H4 tags do present a couple of potential accessibility problems that I hadn’t thought about before.

    The issue is that screen readers and text-to-speech readers use the section heading levels to parse how each post’s content is organized so that the software knows how to read the content to the user in an order that makes sense. So, if some heading levels are skipped or duplicated, the reader software can get confused and might, for example, skip from the main column text to a sidebar widget and then back (especially if the main column also has H4 and H5 tags).

    That can be mitigated somewhat by using HTML5 and/or ARIA attributes to distinguish the content area from the sidebar, but that wouldn’t necessarily help if people have widgets before and after posts. The ideal solution would probably be to change the widget titles from H4 to DIV. That way, they wouldn’t implicate the order of the main content text or impose any hierarchy on the widgets.

    I hadn’t thought about this before — I’ve been guilty of using heading level tags as a convenient formatting shortcut rather than a hierarchical tool — but it’s something to consider for future versions.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Is there a way to change the H4 tags’ is closed to new replies.