How can I add an incremental class identifier to my sidebar widgets?

There doesn’t seem to be an easy way to do this. However, you can try this rather hackish approach: add_filter(‘dynamic_sidebar_params’, ‘my_sidebar_params_cb’); function my_sidebar_params_cb($params) { global $my_widget_counter; if (empty($my_widget_counter)) $my_widget_counter = 1; else $my_widget_counter++; $params[0][‘before_widget’] = str_replace(‘class=”‘, ‘class=”widget_nr_’.$my_widget_counter.’ ‘, $params[0][‘before_widget’]); return $params; }

How to load different CSS in different Header?

Enqueue style depending on a template filename: if(‘header.php’ == basename( get_page_template() ) { // check the template file name // enqueue header.php style here } if(‘header-full.php’ == basename( get_page_template() ) { // check the template file name // enqueue header-full.php style here } wp_enqueue_style already registers a style so you don’t need to register a … Read more