Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created August 29, 2015 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/5a710b9d759da3311b43 to your computer and use it in GitHub Desktop.
Save billerickson/5a710b9d759da3311b43 to your computer and use it in GitHub Desktop.
<?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