
­­­­­­­­­­­­­­­­­­
<!DOCTYPE html>
<html>
<?php /* Init the post data */
if ( is_singular() && have_posts() ) { the_post(); }

$classes = '';

if ( presso_has_title_bg() ) {
	$classes .= ' vw-title-area--has-bg';
}
?>

<div class="vw-title-area <?php echo esc_attr( $classes ); ?>">

	<div class="vw-title-area__background"></div>

	<div class="vw-title-area__inner">
		
		<div class="vw-title-area__box container">
			<?php if ( is_author() ) : ?>
				<?php get_template_part( 'templates/single/about-author' ); ?>
				
			<?php elseif ( presso_is_woocommerce() ) : ?>

				<?php if ( is_shop() ) : ?>
					<h1 class="vw-title-area__title"><?php echo esc_html( get_the_title( presso_get_shop_page_id() ) ); ?></h1>
					<?php presso_the_tagline( 'vw-title-area__tagline', presso_get_shop_page_id() ); ?>

				<?php elseif ( is_product_category() || is_product_tag() ) : ?>
					<h1 class="vw-title-area__title"><?php presso_the_archive_title(); ?></h1>
					
				<?php endif; ?>

			<?php elseif ( is_archive() ) : ?>
				<h1 class="vw-title-area__title"><?php presso_the_archive_title(); ?></h1>
				<?php presso_the_archive_tagline( 'vw-title-area__tagline' ); ?>

			<?php elseif ( is_attachment() ) : ?>
				<h1 class="vw-title-area__title"><?php the_title(); ?></h1>
				<div class="vw-title-area__tagline"><span><?php presso_the_location_link(); ?></span></div>
				
			<?php elseif ( is_singular( 'presso_gallery' ) && strpos( $layout = get_post_meta( get_the_id(), 'vw_gallery_layout', true ), 'full-width' ) !== false ) : ?>


			<?php elseif ( is_page() || is_singular( array( 'presso_portfolio', 'presso_gallery' ) ) ) : ?>
				<h1 class="vw-title-area__title"><?php the_title(); ?></h1>
				<?php presso_the_tagline( 'vw-title-area__tagline' ); ?>

			<?php elseif ( is_single() ) : ?>
				<?php presso_the_category(); ?>
				
				<h1 class="vw-title-area__title"><?php the_title(); ?></h1>
				<?php presso_the_tagline( 'vw-title-area__tagline' ); ?>

				<div class="vw-title-area__post-meta">
					<?php presso_the_author( PRESSO_CONST_AVATAR_SIZE__SINGLE ); ?>
					<?php presso_the_post_date(); ?>
					<?php presso_the_post_view(); ?>
				</div>

			<?php elseif ( is_home() ) : ?>
				<?php
				$page_for_posts = get_option( 'page_for_posts' );
				if ( ! empty( $page_for_posts ) ) : 
						$title = get_the_title( $page_for_posts );
				?>

					<h1 class="vw-title-area__title"><?php echo esc_html( $title ); ?></h1>
					<?php presso_the_tagline( 'vw-title-area__tagline', $page_for_posts ); ?>

				<?php else : ?>
					<h1 class="vw-title-area__title"><?php esc_html_e( 'Blog', 'presso' ); ?></h1>

				<?php endif; ?>

			<?php elseif ( is_search() ) : ?>

				<?php if ( get_search_query() ) : ?>
					<h1 class="vw-title-area__title"><?php printf( esc_html__( 'Search Result for <em>&ldquo;%s&rdquo;</em>', 'presso' ), get_search_query() ); ?></h1>

				<?php else : ?>
					<h1 class="vw-title-area__title"><?php esc_html_e( 'Search', 'presso' ); ?></h1>

				<?php endif; ?>

				<?php presso_the_tagline( 'vw-title-area__tagline' ); ?>

			<?php endif; ?>
		</div>
	</div>

	<?php //if ( is_single() && has_post_format( 'gallery' ) ): ?>
		<div class="vw-title-area__nav hidden">
			<a href="#" class="vw-title-area__nav-button vw-title-area__nav-button--prev"><i class="vw-icon icon-entypo-left-open-big"></i></a>
			<a href="#" class="vw-title-area__nav-button vw-title-area__nav-button--next"><i class="vw-icon icon-entypo-right-open-big"></i></a>
		</div>
	<?php //endif; ?>
	
</div>

<?php /* Rewind the post data */
if ( is_singular() && have_posts() ) { rewind_posts(); }
?>