So I want to add a widget area in my sidebar, that resizes the widgets depending on how many widgets are active. So like, if there are 3 active widgets, then each one will be like 33% the width of the container.
My widget is set up like :
register_sidebar(array(
'name' => __( 'Front page Widgets' ),
'id' => 'front-page',
'description' => __( 'Widgets in this area will appear on the front page.' ),
'before_widget' =>'<li class="span4">',
'before_title' => '<h3>',
'after_title' => '</h3>'
));
I can count the number of active widgets with this
$sidebars = wp_get_sidebars_widgets();
$footerWidgetCount = count( $sidebars['footer-widgets'] );
But how would I go about passing $footerWidgetCount into my widget? Id like to be able to pass a new value for before_widget so I could resize it on the fly. Is that possible?