[wp-trac] [WordPress Trac] #44656: Multiple themes: Empty site title leaves empty anchor tag in header (was: Twenty Twelve: Empty site title leaves empty anchor tag in header)

WordPress Trac noreply at wordpress.org
Fri Jun 9 23:51:09 UTC 2023


#44656: Multiple themes: Empty site title leaves empty anchor tag in header
---------------------------+-----------------------------
 Reporter:  tsquez         |       Owner:  (none)
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Future Release
Component:  Bundled Theme  |     Version:
 Severity:  normal         |  Resolution:
 Keywords:  needs-patch    |     Focuses:
---------------------------+-----------------------------
Changes (by sabernhardt):

 * keywords:  needs-testing has-patch => needs-patch


Comment:

 I do not like allowing empty links or headings; however, (as noted above)
 most of the classic bundled themes have given superfluous markup when
 sites have not included a site title and/or tagline. If we fix it for
 Twenty Twelve, we probably should edit other themes, too.

 Twenty Ten creates an empty link inside a heading if the site has no
 title. An empty tagline results in an empty `div` (which usually is not a
 problem).
 {{{
 <h1 id="site-title">
         <span>
                 <a href="https://example.com/" rel="home"></a>
         </span>
 </h1>
 <div id="site-description"></div>
 }}}

 Twenty Eleven gives an empty link and/or heading.
 {{{
 <hgroup>
         <h1 id="site-title"><span><a href="https://example.com/"
 rel="home"></a></span></h1>
         <h2 id="site-description"></h2>
 </hgroup>
 }}}

 Twenty Twelve likewise gives an empty link and/or heading.
 {{{
 <hgroup>
         <h1 class="site-title"><a href="https://example.com/"
 rel="home"></a></h1>
         <h2 class="site-description"></h2>
 </hgroup>
 }}}

 Twenty Thirteen adds empty headings inside of a link.
 {{{
 <a class="home-link" href="https://example.com/" rel="home">
         <h1 class="site-title"></h1>
         <h2 class="site-description"></h2>
 </a>
 }}}

 Twenty Fourteen, Twenty Fifteen, Twenty Sixteen and Twenty Seventeen all
 add a link inside a heading on the expectation that the site has a title.
 These four themes will, however, skip adding markup without a tagline.
 {{{
 <h1 class="site-title"><a href="https://example.com/" rel="home"></a></h1>
 }}}

 Twenty Twenty has slightly different markup, but it similarly leaves an
 empty link inside a heading when the site lacks a site title (and the
 theme does not include anything for an empty tagline).
 {{{
 <div class="header-titles">
         <h1 class="site-title"><a href="https://example.com/"></a></h1>
 </div>
 }}}

 Twenty Nineteen and Twenty Twenty-One do not have any markup for either an
 empty site title or an empty tagline.
 {{{
 <div class="site-branding">
 </div>
 }}}

 The block themes do not have any output for empty site titles either.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44656#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list