• Resolved redcore

    (@redcore)


    I think this started happening after the 3.9 update, but now the_title() function is automatically wrapping the title in H1 tags. This is breaking a bunch of stuff on my theme (Definition by Wootheme), like adding H1 to the next/previous article buttons, recent articles sidebar, etc.

    Is there a setting that has gone haywire that I can rectify on my end?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi there! ??

    I just checked the WordPress core files and the_title() as it is being used with a default WordPress install doesn’t automatically code for things wrapped in the the_title() to have a h1 tag or any h tag at all.

    All it does – and I checked both the default post and widgets templates in the includes folder – is literally output the title of the post/article in question.

    As it stands, it is up to the theme to specify any styling.

    Additionally, I am in the middle of building a barebones theme and any h1 tags that appear are of my own doing – for example, specifying the general appearance of each widget in my functions.php and asking for the .widget-title to have an h1 tag.

    My list of Recent Posts (using WordPress’ default widgets) or anything listing my own posts (like pagination from next to previous) simply shows the title of the post without any automatic styling.

    That said, I believe it’s something in your theme rather than something in the newly updated WordPress core.

    Try swapping to another theme – a default theme if possible – and see if you see the same things happening.

    Thread Starter redcore

    (@redcore)

    Thanks. After checking a local test copy I have (“relative” copy, I’m terrible about testing and keeping them in sync, apparently) with WP 3.9 and the same Definition version, that H1 issue didn’t exist, so I figured it must be a plugin – perhaps one got updated by the client who didn’t remember to check the site after upgrading ??

    I had “PHP Code for posts” installed to play around with awhile back but never ended up using it, when I disabled it, the problem went away. When I re-enabled it, the problem was still gone…perhaps there was just something messed up with it’s upgrade. I’ll just remove it anyways, since I don’t need it.

    Thanks for helping me troubleshoot ??

    Absolutely welcome. ??

    I’ve triggered some pretty weird bugs before when doing upgrades myself over the years including making my entire sidebar/widget areas disappear.

    Like you, some of them have come from plugins and other times, from themes and in most cases, they simply needed to be deactivated before upgrading and then reactivated again to clear the problem.

    Glad to hear it fixed!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘the_title() automatically adding H1 tags’ is closed to new replies.