saragreenlaw
3/16/2017 - 1:12 PM

Add new widget area between posts in Genesis

Add new widget area between posts in Genesis


//* Add new widget Between Posts Area 
genesis_register_sidebar( array(
'id' => 'between-posts-area',
'name' => __( 'Between Posts Area', 'basicwp-theme' ),
'description' => __( 'This widget show between and after few posts.', 'basicwp-theme' ),
) );

//* Add widget area between and after 3 posts
add_action( 'genesis_after_entry', 'basicwptheme_between_posts_area' );

function basicwptheme_between_posts_area() {
global $loop_counter;

$loop_counter++;

if( $loop_counter == 3 ) {


if ( is_active_sidebar( 'between-posts-area' ) ) {
    echo '<div class="between-posts-area widget-area"><div class="wrap">';
	dynamic_sidebar( 'between-posts-area' );
	echo '</div></div><!-- end .top -->';
	}

$loop_counter = 0;

}

}