Created
December 30, 2013 17:56
-
-
Save billerickson/8185415 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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