Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created December 30, 2013 17:56
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/8185415 to your computer and use it in GitHub Desktop.
Save billerickson/8185415 to your computer and use it in GitHub Desktop.
<?php
// Image Size to be used
add_image_size( 'be_header', 960, 180, true );
/**
* Display header image below navigation
*
*/
function be_header_image() {
// Only run on single posts/pages
if( !is_singular() )
return;
// Get image ID, stored as post meta
$image_id = get_post_meta( get_the_ID(), 'be_header_image', true );
if( empty( $image_id ) )
return;
echo '<div class="header-image">' . wp_get_attachment_image( $image_id, 'be_header' ) . '</div>';
}
add_action( 'genesis_after_header', 'be_header_image', 20 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment