get_template_directory_uri(). '/assets/uploads/header-image.jpg',
'default-text-color' => '000000',
'width' => 1300,
'height' => 720,
'flex-height' => true,
) ) );
}
add_action( 'after_setup_theme', 'business_center_pro_custom_header_setup' );
if ( ! function_exists( 'business_center_pro_header_image_meta_option' ) ) :
/**
* Check header image option meta
*
* @since Business Center Pro 2.0.0
*
* @return string Header image meta option
*/
function business_center_pro_header_image_meta_option() {
if ( is_archive() || is_404() || is_search() ) {
if ( get_header_image() ) {
return '
';
} else {
return '
';
}
} else {
global $post;
$post_id = $post->ID;
if ( !is_front_page() && is_home() ) {
$post_id = get_option( 'page_for_posts' );
}
if ( is_front_page() && is_home() ) {
if ( get_header_image() ) {
return '
';
} else {
return '
';
}
}
$header_image_meta = get_post_meta( $post_id, 'business-center-pro-header-image', true );
if ( 'enable' == $header_image_meta ) {
if ( has_post_thumbnail( $post_id ) ) {
return get_the_post_thumbnail( $post_id, '', the_title_attribute( 'echo=0' ) );
} else {
return '
';
}
} elseif ( 'default' == $header_image_meta ) {
if ( get_header_image() ) {
return '
';
} else {
return '
';
}
} elseif ( 'disable' == $header_image_meta ) {
return false;
}
}
}
endif;
if ( ! function_exists( 'business_center_pro_display_custom_header' ) ) :
/**
* Custom header for single and other templates
*
* @since Business Center Pro 2.0.0
*
*/
function business_center_pro_display_custom_header() {
$business_center_pro_header_image_meta = business_center_pro_header_image_meta_option();
if ( ! empty( $business_center_pro_header_image_meta ) ) { ?>