Skip to content

Instantly share code, notes, and snippets.

@studiopress
Last active April 9, 2019 16:39
Show Gist options
  • Save studiopress/34154711855bed634dd3a0172ffbb331 to your computer and use it in GitHub Desktop.
Save studiopress/34154711855bed634dd3a0172ffbb331 to your computer and use it in GitHub Desktop.
Create custom category template file.
<?php
// Add newsletter signup box after 6th entry.
add_action( 'genesis_after_entry', 'theme_newsletter_widget_area' );
function theme_newsletter_widget_area() {
global $wp_query;
$counter = $wp_query->current_post;
if ( 5 == $counter ) {
genesis_widget_area( 'newsletter', array(
'before' => '<div class="newsletter">',
'after' => '</div>',
) );
}
}
// Run Genesis loop.
genesis();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment