you CAN do this with my widget logic plugin
http://ww.wp.xz.cn/extend/plugins/widget-logic/
using the widget_content filter capability. and this in your functions.php:
add_filter(‘widget_content’, ‘make_alternating_widget_styles’);
function make_alternating_widget_styles($content=”)
{ global $make_alt_ws;
$make_alt_ws=($make_alt_ws==”style_a”)?”style_b”:”style_a”;
return preg_replace(‘/(class=”widget )/’, “$1 widget_${make_alt_ws} “, $content);
}
so if your widgets are usually class=”widget …” this will add in “widget_style_a”/”widget_style_b” into that class definition.
Thread Starter
eryanv
(@eryanv)
I was hoping something would be built into core, but this works too.
Thanks.
Having it in the functions.php file is a much better option as it won’t be saved over when the core is updated.