Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save CapWebSolutions/a3f7fe4f03e6475cc152c6c3a6e419f0 to your computer and use it in GitHub Desktop.

Select an option

Save CapWebSolutions/a3f7fe4f03e6475cc152c6c3a6e419f0 to your computer and use it in GitHub Desktop.
Adds specified widget area after 3rd post in archive
//* 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