Widget title not displaying in WordPress version 5.8.2
-
Hello, I am trying to build custom WordPress theme and when I added widget there is no title being displayed.
Screen shot: https://ibb.co/cgbW8MR
Widget code:
function wphierarchy_widget_init() {
register_sidebar( [
‘name’ => esc_html__( ‘Main Sidebar’, ‘wphierarchy’ ),
‘id’ => ‘main-sidebar’,
‘description’ => esc_html__( ‘Add widgets here.’, ‘wphierarchy’ ),
‘before_widget’ => ‘<section class=”widget”>’,
‘class’ => ‘custom-widget-area’,
‘after_widget’ => ‘</section>’,
‘before_title’ => ‘<h2 class=”widget-title”>’,
‘after_title’ => ‘</h2>’,
] );
// Secondary widget for footer
register_sidebar( [
‘name’ => esc_html__( ‘Footer Sidebar’, ‘wphierarchy’ ),
‘id’ => ‘footer-sidebar’,
‘description’ => esc_html__( ‘Add widgets here.’, ‘wphierarchy’ ),
‘before_widget’ => ‘<section class=”widget”>’,
‘class’ => ‘custom-widget-area’,
‘after_widget’ => ‘</section>’,
‘before_title’ => ‘<h2 class=”widget-title”>’,
‘after_title’ => ‘</h2>’,
] );
}
add_action(‘widgets_init’, ‘wphierarchy_widget_init’ );
- The topic ‘Widget title not displaying in WordPress version 5.8.2’ is closed to new replies.