-
-
Save billerickson/5a710b9d759da3311b43 to your computer and use it in GitHub Desktop.
This file contains 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 | |
/** | |
* Featured Post | |
* | |
*/ | |
function be_featured_post() { | |
// Do not run on subsequent pages | |
if( get_query_var( 'paged' ) ) | |
return; | |
// Set up the first post. | |
the_post(); | |
echo '<div class="featured-post">'; | |
if( has_post_thumbnail() ) | |
echo '<p><a href="' . get_permalink() . '">' . get_the_post_thumbnail( get_the_ID(), 'large' ) . '</a></p>'; | |
echo '<h2><a href="' . get_permalink() . '">' . get_the_title() . '</a></h2>'; | |
the_excerpt(); | |
echo '</div>'; | |
} | |
add_action( 'genesis_after_header', 'be_featured_post' ); | |
genesis(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment