-
-
Save braddalton/d5508cb2aaf2a8c032ed 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
/** Register New Widget */ | |
genesis_register_sidebar( array( | |
'id' => 'first-post', | |
'name' => __( 'Widget After First Post', 'wpsites' ), | |
'description' => __( 'Displays Your Widget Content After The First Post.', 'wpsites' ), | |
) ); | |
add_action( 'genesis_after_entry', 'widget_after_first_post' ); | |
/** | |
* Brad Dalton | |
* example http://wpsites.net/web-design/add-content-after-any-number-of-post-excerpts-in-any-type-of-archive/ | |
*/ | |
function widget_after_first_post() { | |
global $post_count; | |
++$post_count; | |
if ( ( is_front_page() ) && 1 == $post_count ) { | |
genesis_widget_area( 'first-post', array( | |
'before' => '<div class="first-post widget-area">', | |
'after' => '</div>', | |
) ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment