Closed salcode closed 9 years ago
I'm guessing the white screen of death is due to calling genesis_register_sidebar()
before the Genesis files are loaded by WordPress.
The following code adds a widget area
add_action( 'genesis_setup', 'test_bsg_add_widget_area', 15 );
function test_bsg_add_widget_area() {
genesis_register_sidebar( array(
'id' => 'test_bsg_widget_area',
'name' => __( 'Test BSG Widget Area', 'bsg' ),
) );
}
If the genesis_register_sidebar()
function is called without the function wrapped around it, i.e. it executes as soon as functions.php
runs and does not wait for the genesis_setup
hook, the site will have a fatal error and display the white screen.
Instead of genesis_register_sidebar()
, it is preferable to use genesis_register_widget_area()
making the code
add_action( 'genesis_setup', 'test_bsg_add_widget_area', 15 );
function test_bsg_add_widget_area() {
genesis_register_widget_area( array(
'id' => 'test_bsg_widget_area',
'name' => __( 'Test BSG Widget Area', 'bsg' ),
) );
}
Both functions do the same thing (genesis_register_sidebar()
is an alias for genesis_register_widget_area
). The sidebar version remains for backwards compatibility.
Thanks Sal, this is now resolved.
@JacoVintage glad to hear it, thanks for the note.
I received the following bug report.
At this point, this issue needs to be researched and recreated.