Alternating widget styles
-
I just upgraded to 3.3.1 and my widget style filter is broken. Is there a new way to inject the filter?
add_filter('widget_content', 'make_alternating_widget_styles'); function make_alternating_widget_styles($content='') { global $make_alt_ws, $make_alt_ws2; if(preg_match('/(sb2 )/', $content)){ $make_alt_ws=($make_alt_ws=="style_a")?"style_b":"style_a"; return preg_replace('/(class="widget )/', "$1 widget_${make_alt_ws} ", $content); } else { $make_alt_ws2=($make_alt_ws2=="style_a")?"style_b":"style_a"; return preg_replace('/(class="widget )/', "$1 widget_${make_alt_ws2} ", $content); } }
- The topic ‘Alternating widget styles’ is closed to new replies.