Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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
You can’t perform that action at this time.