functions – Customising widget titles/headings in WP 5.8


So I have updated WP to 5.8 and the widget titles are no longer being recognized from my customized functions.php

'name'          => __( 'Sidebar 1', 'mytheme' ),
'id'            => 'sidebar-1',
'before_widget' => '<div id="sidebar">',
'before_title' => '<h1 class="sidebar-title"><span>',
'after_title' => '</span></h1>',
'after_widget' => '</div>',

I’m racking my brains and I can’t seem to solve it because it’s a new change and no one seems to have asked this anywhere. My widgets want to have <h2>Title</h2> no matter what I put in functions. There is no sign of my H1 class. Plus massive spaces/padding because I think the titles (“headings” now apparently) are outside of my widget blocks. If i revert back to an older WP version, it works just fine. I can’t use any plugins. Am I missing something obvious?

itsneversimple 4 weeks 2021-08-24T23:55:42-05:00 0 Answers 0 views 0

Leave an answer