此代码处理边栏:
add_action( \'genesis_sidebar\', \'genesis_do_sidebar\' );
/**
* Echo primary sidebar default content.
*
* Only shows if sidebar is empty, and current user has the ability to edit theme options (manage widgets).
*
* @since 1.2.0
*/
function genesis_do_sidebar() {
if ( ! dynamic_sidebar( \'sidebar\' ) && current_user_can( \'edit_theme_options\' ) ) {
genesis_default_widget_area_content( __( \'Primary Sidebar Widget Area\', \'genesis\' ) );
}
}
您可以取消挂钩
genesis_do_sidebar
从…起
genesis_sidebar
, 然后连接您自己的侧栏功能,以防止输出默认内容:
remove_action( \'genesis_sidebar\', \'genesis_do_sidebar\' );
add_action( \'genesis_sidebar\', \'wpse_genesis_do_sidebar\' );
/**
* Outputs widgets for sidebar without default content.
*/
function wpse_genesis_do_sidebar() {
dynamic_sidebar( \'sidebar\' );
}