Last active
August 29, 2015 14:26
-
-
Save wbxpress/43281d2199bef98b90c4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* Add new widget area between posts of home page | |
genesis_register_sidebar( array( | |
'id' => 'between-posts-area', | |
'name' => __( 'Between Posts Area', 'genesis-theme' ), | |
'description' => __( 'This widget show between and after few posts.', 'genesis-theme' ), | |
) ); | |
//* Add widget area between and after 2 posts | |
add_action( 'genesis_after_entry', 'wbxp_between_posts_area' ); | |
function wbxp_between_posts_area() { | |
global $loop_counter; | |
$loop_counter++; | |
if( $loop_counter == 2 ) { | |
if ( is_active_sidebar( 'between-posts-area' ) ) { | |
echo '<div class="wbxp-google-ads">'; | |
dynamic_sidebar( 'between-posts-area' ); | |
echo '</div><!-- end .top -->'; | |
} | |
$loop_counter = 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment