ID), 'full');
$image_width = $featured_image[1];
}
// If that featured image is full-width (>1170px wide), then use it
if ( $content_width AND $image_width >= $content_width ) {
$image_url = $featured_image[0];
$image_type = 'featured';
// If custom header not already displayed (via header.php), then use it here
} elseif ( $custom_header_location != 'header' AND get_header_image() ) {
$image_url = get_header_image();
$image_type = 'header';
$image_width = get_custom_header()->width;
} //endif $image_width
/*
* GET THE TEXT TO DISPLAY ON THE IMAGE OR CONTENT HEADER SECTION
*/
// If home page is blog and site title already displayed (via header.php), do nothing
if ( is_home() AND is_front_page() AND $custom_header_location != 'content-header' ) {
// If home page is blog and site title not already displayed (via header.php), get text from site
} elseif ( is_home() AND is_front_page() AND $custom_header_location != 'header' ) {
$title = get_bloginfo('name');
$subtitle = get_bloginfo('description');
// If home page is static and we are on the blog page
} elseif ( is_home() AND ! is_front_page() ) {
$home_page = get_option ( 'page_for_posts' );
if ( $home_page ) $post = get_post( $home_page );
if ( $post ) {
$title = $post->post_title;
} else {
$title = __( 'Blog', 'flat-bootstrap' );
}
$subtitle = get_post_meta( $home_page, '_subtitle', $single = true );
// Otherwise if we have a featured image, try to get text from the image
} elseif ( $image_type == 'featured' ) {
$attachment_post = get_post( get_post_thumbnail_id() );
if ( $attachment_post AND ( $attachment_post->post_excerpt OR $attachment_post->post_content ) ) {
$title = $attachment_post->post_title;
$subtitle = $attachment_post->post_excerpt;
$description = $attachment_post->post_content;
}
} elseif ( is_post_type_archive( 'jetpack-portfolio' ) OR is_tax ( 'jetpack-portfolio-type' ) OR is_tax ( 'jetpack-portfolio-tag' ) ) {
$title = __( 'Portfolio', 'flat-bootstrap' );
if ( is_tax( 'jetpack-portfolio-type' ) || is_tax( 'jetpack-portfolio-tag' ) ) {
$subtitle = single_term_title( null, false );
}
} elseif ( is_post_type_archive( 'jetpack-testimonial' ) OR $post->post_type == 'jetpack-testimonial' ) {
$testimonial_options = get_theme_mod( 'jetpack_testimonials' );
if ( $testimonial_options ) {
$title = $testimonial_options['page-title'];
} else {
$title = __( 'Testimonials', 'flat-bootstrap' );
}
if ( !is_post_type_archive( 'jetpack-testimonial' ) AND $post->post_type == 'jetpack-testimonial' ) {
$subtitle = get_the_title();
}
} elseif ( is_page() OR is_single() ) {
$title = get_the_title();
} elseif ( is_category() ) {
$title = single_cat_title( false );
} elseif ( is_tag() ) {
$title = single_tag_title( false );
} elseif ( is_author() ) {
// Queue the first post, that way we know what author we're dealing with
the_post();
$title = sprintf( __( 'Author: %s', 'flat-bootstrap' ), '' . get_the_author() . '' );
// Since we called the_post() above, we need to rewind the loop back to the beginning that way we can run the loop properly, in full.
rewind_posts();
} elseif ( is_search() ) {
$title = sprintf( __( 'Search Results for: %s', 'flat-bootstrap' ), '' . get_search_query() . '' );
} elseif ( is_day() ) {
$title = sprintf( __( 'Day: %s', 'flat-bootstrap' ), '' . get_the_date() . '' );
} elseif ( is_month() ) {
$title = sprintf( __( 'Month: %s', 'flat-bootstrap' ), '' . get_the_date( 'F Y' ) . '' );
} elseif ( is_year() ) {
$title = sprintf( __( 'Year: %s', 'flat-bootstrap' ), '' . get_the_date( 'Y' ) . '' );
} elseif ( is_tax( 'post_format', 'post-format-aside' ) ) {
$title = __( 'Asides', 'flat-bootstrap' );
} elseif ( is_tax( 'post_format', 'post-format-image' ) ) {
$title = __( 'Images', 'flat-bootstrap');
} elseif ( is_tax( 'post_format', 'post-format-video' ) ) {
$title = __( 'Videos', 'flat-bootstrap' );
} elseif ( is_tax( 'post_format', 'post-format-quote' ) ) {
$title = __( 'Quotes', 'flat-bootstrap' );
} elseif ( is_tax( 'post_format', 'post-format-link' ) ) {
$title = __( 'Links', 'flat-bootstrap' );
} else {
$title = __( 'Archives', 'flat-bootstrap' );
} //endif is_home()
//If subtitle not set above, first try the term description, then try our custom page subtitle field
if ( ! $subtitle ) {
$subtitle = term_description();
if ( ! $subtitle ) $subtitle = get_post_meta( get_the_ID(), '_subtitle', $single = true );
}
/*
* IF WE HAVE AN IMAGE, THEN DISPLAY IT WITH THE TEXT AS AN OVERLAY
*/
if ( $image_url ) :
// Set larger image size on front page
if ( is_front_page() ) {
$image_class = 'cover-image';
$overlay_class = 'cover-image-overlay';
} else {
$image_class = 'section-image';
$overlay_class = 'section-image-overlay';
}
// Display the image and text
?>