transmitstudio
10/16/2015 - 10:29 PM

Get header image and display it

Get header image and display it

<?php

// display user's selected header image; if not chosen, display generic header image
// header image is 2000px x 900px minimum
$header_image = get_field('post_header_image');
if( !empty($header_image) ): ?>
	<div class="xmit-page-header" style="background-image: url(<?php echo $header_image['url']; ?>);">
<?php elseif (empty($header_image)): ?>
	<div class="xmit-page-header" style="background-image:url(<?php bloginfo('stylesheet_directory');?>/images/generic-header.jpg);">
<?php endif;