Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created March 13, 2015 19:06
Show Gist options
  • Save billerickson/7e1c1de1e6ff592aa14a to your computer and use it in GitHub Desktop.
Save billerickson/7e1c1de1e6ff592aa14a to your computer and use it in GitHub Desktop.
<?php
/**
* Teaser Headline
*
*/
function be_teaser_headline() {
global $wp_query;
if( in_array( 'teaser', get_post_class() ) && 2 == $wp_query->current_post && ! get_query_var( 'paged' ) )
echo '<h3>Teasers</h3>';
}
add_action( 'genesis_before_entry', 'be_teaser_headline' );
@billerickson
Copy link
Author

Translation of line 10: If this post has a class of 'teaser' (so we're looking at a grid loop), AND the current post count is 2 (remember it starts counting at 0 so this means we're on the 3rd post) AND we're not on a subpage (no /page/xxx in the URL), then display the teaser headline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment