Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/**
* Header end html codes
*
* @since Chrisporate Pro 1.0.0
*
*/
function chrisporate_pro_header_banner() {
$options = chrisporate_pro_get_theme_options();
$vid_class = ( has_header_video() && chrisporate_pro_is_frontpage() ) ? 'video-enabled' : '';
?>
<div id="header-featured-image" class="<?php echo esc_attr( $vid_class ); ?> relative">
<div class="overlay"></div>
<?php
if ( is_singular() && ! is_front_page() && ! is_home() ) :
$header_image = get_post_meta( get_the_id(), 'chrisporate-pro-header-image', true );
if ( 'featured-image' === $header_image ) :
if ( has_post_thumbnail() ) : ?>
<div id="wp-custom-header" class="wp-custom-header">
<?php the_post_thumbnail( 'full', array( 'alt' => the_title_attribute( 'echo=0' ) ) ); ?>
</div>
<?php else :
the_custom_header_markup();
endif;
else :
the_custom_header_markup();
endif;
else :
the_custom_header_markup();
endif;
if ( chrisporate_pro_is_frontpage() ) :
if ( ! empty( $options['banner_section_title'] ) || ! empty( $options['banner_section_sub_title'] ) ) : ?>
<div class="video-content">
<div class="video-title">
<?php if ( ! empty( $options['banner_section_title'] ) ) : ?>
<h1><?php echo esc_html( $options['banner_section_title'] ); ?></h1>
<?php endif;
if ( ! empty( $options['banner_section_sub_title'] ) ) : ?>
<h2><?php echo esc_html( $options['banner_section_sub_title'] ); ?></h2>
<?php endif; ?>
</div><!-- .video-title -->
</div><!-- .video-content -->
<?php endif; ?>
<div class="move-down">
<a href="#content" class="scroll-link">
<img src="<?php echo get_template_directory_uri(); ?>/assets/uploads/icon-01.png" alt="icon" class="icon-animation">
</a>
</div><!-- .move-down -->
<?php else : ?>
<div class="container">
<div class="page-detail">
<header class="page-header">
<h1 class="page-title">
<?php if ( is_singular() ) {
the_title();
} elseif( is_404() ) {
esc_html_e( '404', 'chrisporate-pro' );
} elseif( is_search() ){
printf( esc_html__( 'Search Result for: %s', 'chrisporate-pro' ), get_search_query() );
} elseif ( is_archive() ) {
if ( class_exists( 'WooCommerce' ) && is_shop() )
woocommerce_page_title();
else
the_archive_title();
} elseif ( is_home() ) {
if ( is_home() && ! is_front_page() ) :
echo ! empty( $options['your_latest_posts_title'] ) ? esc_html( $options['your_latest_posts_title'] ) : esc_html__( 'Blogs', 'chrisporate-pro' );
endif;
} elseif ( is_tax( 'product_cat' ) ) {
woocommerce_page_title();
}
?>
</h1>
</header><!-- .page-header -->
<?php chrisporate_pro_add_breadcrumb(); ?>
</div><!-- .page-detail -->
</div><!-- .container -->
<?php endif; ?>
</div><!-- #video-wrapper -->
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.