Skip to content

Instantly share code, notes, and snippets.

@Steeru
Created May 2, 2018 04:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Steeru/f39c02b7b2e0651086e159501d8d7f9c to your computer and use it in GitHub Desktop.
Save Steeru/f39c02b7b2e0651086e159501d8d7f9c to your computer and use it in GitHub Desktop.
/**
* Main header
*
* @since Biography 1.0.0
*
* @param null
* @return null
*
*/
function biography_header() {
global $biography_customizer_all_values;
if ( function_exists( 'has_custom_logo' ) ) {
$biography_logo = get_custom_logo();
}
elseif ( !function_exists( 'has_custom_logo' ) ) {
$biography_logo = esc_url($biography_customizer_all_values['biography-logo']);
}
$biography_header_bg_img = biography_banner_image( get_the_ID() );
$biography_enable_social_icons = esc_attr( $biography_customizer_all_values['biography-enable-social-icons'] );
$nav_col_fixed = 'col-md-12 col-sm-12';
if( 1 == $biography_enable_social_icons ){
if( has_nav_menu( 'social' ) ) {
$nav_col_fixed = 'col-md-6 col-sm-8';
}
}?>
<header id="masthead" class="site-header block-section biography-nav-left" role="banner" style="background-image: url('<?php echo $biography_header_bg_img;?>');">
<div class="block-overlay-content">
<div class="head-top">
<div class="container">
<div class="<?php echo esc_attr( $nav_col_fixed);?> col-xs-12">
<nav id="site-navigation" class="main-navigation" role="navigation">
<button class="menu-toggle" aria-controls="primary-menu" aria-expanded="false">
<i class="fa fa-bars"></i>
</button>
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_id' => 'primary-menu' ) ); ?>
</nav><!-- #site-navigation -->
</div>
<?php
if( 1 == $biography_enable_social_icons ){
if( has_nav_menu('social')){
?>
<div class="col-md-6 col-sm-4 col-xs-12">
<div class="social-icon-only">
<?php
$social_nav_args = array(
'theme_location' => 'social',
'container' => 'div',
'container_class' => 'biography-social-section',
'depth' => 1
);
wp_nav_menu( $social_nav_args );
?>
</div>
</div>
<?php
}
}
?>
</div>
</div>
<?php
global $biography_customizer_all_values;
if( !FALSE == $biography_customizer_all_values['biography-home-sortable-enable'] ){
?>
<div class="banner-section-sortable">
<?php
}
else {
?>
<div class="banner-section">
<?php } ?>
<div class="container">
<div class="row">
<div class="col-md-12 col-lg-10 col-lg-offset-1">
<div class="banner-inner biography-animate fadeInDown overhidden">
<div class="author-content">
<div class="site-branding">
<?php if ( is_front_page() && is_home() ) : ?>
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
<?php else : ?>
<p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
<?php endif; ?>
<p class="site-description"><?php bloginfo( 'description' ); ?></p>
</div><!-- .site-branding -->
<?php
/**
* biography_action_text_slider hook
* @since Biography 1.0.0
*
* @hooked biography_text_slider -10
* @hooked biography_after_text_slider -20
*/
do_action( 'biography_action_text_slider' );
?>
</div><!-- .author-content -->
<?php
if( !empty( $biography_logo)){
?>
<div class="photo-section">
<span>
<?php if ( !function_exists( 'has_custom_logo' ) ) { ?>
<img src="<?php echo $biography_logo;?>" alt="<?php esc_attr( get_bloginfo( 'name' ) ); ?>">
<?php } else { ?>
<?php echo $biography_logo;?>
<?php } ?>
</span>
</div><!-- .photo-section -->
<?php
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
</header><!-- #masthead -->
<div class="clearfix"></div>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment