Created
February 7, 2018 23:08
-
-
Save CapWebSolutions/a3f7fe4f03e6475cc152c6c3a6e419f0 to your computer and use it in GitHub Desktop.
Adds specified widget area after 3rd post in archive
This file contains hidden or 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 widget area after the third post in archives | |
| add_action( 'genesis_after_entry', 'prefix_archive_widgets' ); | |
| function prefix_archive_widgets() { | |
| if ( !is_archive() ) return; | |
| global $wp_query; | |
| if ( 2 == $wp_query->current_post ) { | |
| genesis_widget_area( 'archive-content-ad', array( | |
| 'before' => '<div class="archive-ad archive-content-ad clearfix">', | |
| 'after' => '</div>', | |
| ) ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment