Make WordPress Core

Opened 5 years ago

Last modified 2 years ago

#44656 new defect (bug)

Twenty Twelve: Empty site title leaves empty anchor tag in header

Reported by: tsquez's profile tsquez Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords: needs-testing has-patch
Focuses: Cc:

Description

I just noticed something weird the other day with Twenty Twelve. I removed the title all together (no I did not hide it) and when I looked at the source code this is what I saw:

<h1 class="site-title">
	<a href="http://localhost/dev/" rel="home"></a>
</h1>

It's an H1 tag with an empty anchor? This shouldn't happen I don't think.

So I download a few other themes and did the same thing and sure enough all that was left was an empty H1 tag with an empty anchor tag.

I do not know why anyone would want to do this BUT If the site title is removed completely, meaning not hidden and not entered not entered either in "Settings" or "Site Identity" in the customizer, then the site H1 site title tag should not be displayed.

I am not sure if this is a bug so I thought I would enter it in. I looked all over and could not find any information or any other tickets regarding this.

I apologize if its a waste of time.

Thanks in advance.

Attachments (3)

44656.diff (1.2 KB) - added by audrasjb 5 years ago.
Adds site-title check before displaying it
44656.1.diff (1.1 KB) - added by sabernhardt 2 years ago.
checks for site title and tagline in Twenty Twelve header
#44656.patch (1.2 KB) - added by rehanali 17 months ago.
Patch Added

Download all attachments as: .zip

Change History (11)

#1 @westonruter
5 years ago

  • Component changed from Customize to Bundled Theme

@audrasjb
5 years ago

Adds site-title check before displaying it

#2 @audrasjb
5 years ago

  • Keywords has-patch added

Hi and welcome to WordPress Trac, @tsquez !

Thanks for the ticket.

Even if it's a small edge case, I'd say we can easily solve it, so let's fix the issue :)

44656.diff adds a condition to check if get_bloginfo( 'name' ) is empty or not.

Cheers,

Jb

#3 @audrasjb
5 years ago

Oops, I didn't noticed you were talking about Twenty Twelve.

My patch is for Twenty Seventeen.

Of course, I can fix the issue on all bundled themes but I'm not sure we are still supporting old bundled themes for such a edge case… (cc @davidakennedy)

#4 @desrosj
4 years ago

  • Keywords needs-patch added; has-patch removed

@laurelfulford Do you have any thoughts as to whether this is something that should be fixed? It seems reasonable to move to Future Release, in my opinion.

#5 @laurelfulford
4 years ago

  • Milestone changed from Awaiting Review to Future Release

@desrosj Agreed! :)

Thanks for the ping -- I've been moving through these tickets backwards, but it's slow going!

#6 @nielslange
4 years ago

  • Keywords needs-testing added; needs-patch removed

#7 @ianbelanger
3 years ago

  • Summary changed from Empty site title leaves empty anchor tag in header to Twenty Twelve: Empty site title leaves empty anchor tag in header
  • Version 4.9.7 deleted

@sabernhardt
2 years ago

checks for site title and tagline in Twenty Twelve header

#8 @sabernhardt
2 years ago

  • Keywords has-patch added

44656.1.diff has the same conditional @audrasjb used for the site title, and it also checks the tagline/description.

@rehanali
17 months ago

Patch Added

Note: See TracTickets for help on using tickets.