只需编辑主题函数。php文件,
查找:register_sidebar 作用
查看name 属性,以确保要更新的小部件
应该有一个名为before_widget
您可以在其中定义自定义CSS类名
以下是示例代码供您参考
register_sidebar( array(
\'name\' => __( \'News Sidebar\', \'left-test-sidebar\' ),
\'id\' => \'sidebar-1\',
\'description\' => __( \'Add widgets here to appear in your sidebar.\', \'depnet\' ),
\'before_widget\' => \'<section id="%1$s" class="widget %2$s YOUR-CUSTOM-CSS-CLASS">\',
\'after_widget\' => \'</section>\',
\'before_title\' => \'<div class="widget-title YOUR-CUSTOM-CSS-CLASS"><h4>\',
\'after_title\' => \'</h4></div>\',
) );