Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter Omnhio

    (@omnhio)

    Thanks a lot! Here’s my approach:

    Functions

    if (!function_exists('groups_frontpage_widgets')):
    function groups_frontpage_widgets($params) {
    	$id = $params[0]['id'];
    	static $counter = 0;
    
    	if ('frontpage-widgets' !== $id) return $params;
    
    	if ( 0 !== $counter && 0 === $counter % 3 )
            $params[0]['before_widget'] = '</div><div class="row">'. $params[0]['before_widget'];
    
    	$counter++;
    
    	return $params;
    }
    endif;
    
    add_filter('dynamic_sidebar_params', 'groups_frontpage_widgets');

    In the template

    <?php // Display Frontpage Widgets
    	if(is_active_sidebar('frontpage-widgets')) : ?>
    		<div id="frontpage-widgets">
    			<div class="row">
    					<?php dynamic_sidebar('frontpage-widgets'); ?>
    				</div>
    		</div>
    	<?php endif; ?>

Viewing 1 replies (of 1 total)