Skip to content

Instantly share code, notes, and snippets.

@JoryHogeveen
Created August 21, 2017 12:37
Show Gist options
  • Save JoryHogeveen/e7837bd1bce2884d3117ada1e4ef7833 to your computer and use it in GitHub Desktop.
Save JoryHogeveen/e7837bd1bce2884d3117ada1e4ef7833 to your computer and use it in GitHub Desktop.
Widget CSS Classes: Define your own classes through filters.
<?php
/**
* Plugin hooks:
* widget_css_classes_first
* widget_css_classes_last
* widget_css_classes_even
* widget_css_classes_odd
* widget_css_classes_number
*
* Passes 1 parameter: the current class
*/
add_filter( 'widget_css_classes_first', 'custom_widget_css_classes_first' );
function custom_widget_css_classes_first( $class ) {
return 'widget-first'; // You can return any valid CSS class.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment