Advertisement
srikat

functions.php

Apr 30th, 2015
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.51 KB | None | 0 0
  1. // Register a custom image size for Singular Featured images
  2. add_image_size( 'singular-featured-thumb', 800, 250, true );
  3.  
  4. add_action( 'genesis_before_entry', 'sk_display_featured_image' );
  5. function sk_display_featured_image() {
  6.     if ( ! is_singular( array( 'post', 'page' ) ) ) {
  7.         return;
  8.     }
  9.     if ( ! has_post_thumbnail() ) {
  10.         return;
  11.     }
  12.     // Display featured image above content
  13.     echo '<div class="singular-featured-image">';
  14.         genesis_image( array( 'size' => 'singular-featured-thumb' ) );
  15.     echo '</div>';
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement