-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[Site Title Block] Encourage users to make proper semantic decisions #29644
Comments
Maybe the option could be moved the advanced section in the block settings sidebar, or vary depending on if it is inside a header template area or not. |
I think in any situation it is ill-advised to make the title anything but an H1, right? Paging @afercia to confirm. If that's the case, let's remove that option completely, and leave the possibility of styling it to the text controls or advanced CSS? |
It is the other way around, for example, on a single post, the most important heading is normally the post title. If it is a landing page without any other type of main heading, and the site title is in the site header, then it should be an H1. |
A common pattern I've seen and implemented is wrapping the site title/logo in an <? if (is_front_page()): ?><h1><? endif; ?>
<strong>
<a href="<? echo esc_url( home_url() ); ?>" rel="home">
<? echo wp_get_attachment_image(get_theme_mod( 'custom_logo' ), 'medium'); ?>
<span <? if (has_custom_logo()) { ?>class="screen-reader-text"<? } ?>>
<? bloginfo( 'name' ); ?>
</span>
</a>
</strong>
<? if (is_front_page()): ?></h1><? endif; ?> Is there any affordance for this pattern in full-site editing? |
The block is not context aware, it does not know if it is on the home page or where it is on the page. I am not sure if there are ny good solutions to this, because I also don't think the element should change automatically without the site creator being aware. |
As for making proper semantic decisions, the document outline will show if headings are in the incorrect order, but maybe it needs to be more visible. |
If there is no way for the user to decide on the title level according to context (homepage vs inner pages), then the site title probably shouldn't be a A survey from 2017 showed that the majority (66%) of screen reader users prefer only one main heading containing the document title. There's also a Google News article that suggests the same as a best practice. |
Yes there is a way, and that is by adding different headers to different pages. That method It is not free from its own problems. |
I mean, an automatic way to do this, as it is already possible with the Site Logo block by using |
What problem does this address?
Currently, with FSE, you can alter aspects of your site you couldn't previously including the Site Title. As a result as part of FSE Outreach Program testing, the following feedback was raised:
What is your proposed solution?
Perhaps similar to how we show warnings for picking low contrast colors, we could show a nudge to encourage people to make good decisions around semantics for blocks like Site Title.
The text was updated successfully, but these errors were encountered: