将此添加到函数中。php
if( !function_exists( \'my_custom_widgetize_theme\' ) ){
add_action ( \'after_setup_theme\', \'my_custom_widgetize_theme\', 10 );
function my_custom_widgetize_theme(){
register_sidebar(array(
\'name\' => \'My SideBar\',
\'id\' => \'my_sidebar\',
\'description\' => \'This is the widgetized Side Bar.\',
\'before_widget\' => \'<div id="%1$s" class="widget %2$s">\',
\'after_widget\' => \'</div>\',
\'before_title\' => \'<h4>\',
\'after_title\' => \'</h4>\'
));
}
}
//this will be display your side bar
<div class="col-lg-6 col-md-6 col-sm-12">
<?php if (function_exists(\'dynamic_sidebar\') && dynamic_sidebar(\'private_event\')); ?>
</div>
添加此代码后,您将在仪表板小部件区域中看到新的侧栏,您可以在那里删除菜单等。。wordpress