Created
March 13, 2015 19:06
-
-
Save billerickson/7e1c1de1e6ff592aa14a to your computer and use it in GitHub Desktop.
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
<?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' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.