I’ve started a new website with the newest WordPress 5.8.
I’ve made a new widget thanks to the new widget builder which use Gutenberg block.
In my functions.php
register_sidebar(
array(
'name' => esc_html__( 'Entête de la page d'accueil', 'domain' ),
'id' => 'head-homepage',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
The template : sidebar-head-homepage.php
If I use this : <?php get_sidebar('head-homepage'); ?>
, the template is called, but by default it’s empty (obvioulsy, cuz the file is empty…) and $args* is empty
If I use this : <?php get_sidebar('head-homepage'); ?>
, data from my widget is rendered, but the template is not callded.
So now, how to call my widget correctly, so that I can use variables to add some CSS on it ?