Advertisement
srikat

Untitled

Jun 10th, 2017
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. // Register custom image size for Featured Hero image.
  2. add_image_size( 'featured-hero', 1910, 936, true );
  3.  
  4. add_action( 'genesis_after_header', 'sk_featured_image' );
  5. /**
  6. * Display featured image (if present) below the header on single Post pages.
  7. */
  8. function sk_featured_image() {
  9. // if this is not a single post having a featured image, abort.
  10. if ( ! ( is_singular( 'post' ) && has_post_thumbnail() ) ) {
  11. return;
  12. }
  13.  
  14. echo '<div class="featured-hero">';
  15. the_post_thumbnail( 'featured-hero' );
  16. echo '</div>';
  17.  
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement