There is a list that is displayed by the widget on the main page. from the way I registered the widget - with the class "submenu" you can look here what the list block http://www.wnero.esy.es looks like

register_sidebar(array( 'name' => 'СФЕРА ДЕЯТЕЛЬНОСТИ', 'id' => "sferadeyatelnosty", 'before_widget' => '<div class="submenu">', //название класса виджета 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>' )); 

But this list will be displayed on another page and I want to prescribe other styles for the list there ..

Therefore, there was a problem - How to change the class name of the widget on another page (for example, from "submenu" to "submenu2")?

    1 answer 1

    If still relevant. To prescribe other styles for this block, if another page is shown, you can refine the class of this list using the unique class for body , which is generated by WP automatically for each page. Screenshot from developer tools

    For example:

     //стандартный вид блока .submenu { background-color: white } //если показана страница с id=7 .page-id-7 .submenu { background-color: silver }