Skip to content

Instantly share code, notes, and snippets.

Created September 19, 2017 10:49
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 anonymous/3b457b1c15a6babbe2abba52170e0e0b to your computer and use it in GitHub Desktop.
Save anonymous/3b457b1c15a6babbe2abba52170e0e0b to your computer and use it in GitHub Desktop.
function travel_eye_add_top_header() {
$contact_question = travel_eye_get_option( 'contact_question' );
$contact_number = travel_eye_get_option( 'contact_number' );
$contact_email = travel_eye_get_option( 'contact_email' );
$show_social_in_header = travel_eye_get_option( 'show_social_in_header' );
?>
<div id="top-header">
<div class="container">
<?php if ( ! empty( $contact_number ) || ! empty( $contact_email ) ) : ?>
<div id="quick-contact">
<ul>
<?php if ( ! empty( $contact_question ) ) : ?>
<li class="quick-message"><?php echo esc_html( $contact_question ); ?></li>
<?php endif; ?>
<?php if ( ! empty( $contact_email ) ) : ?>
<li class="quick-email"><a href="mailto:<?php echo esc_attr( $contact_email ); ?>"><?php echo esc_attr( $contact_email ); ?></a></li>
<?php endif ?>
<?php if ( ! empty( $contact_number ) ) : ?>
<li class="quick-call"><a href="tel:<?php echo preg_replace( '/\D+/', '', esc_attr( $contact_number ) ); ?>"><?php echo esc_attr( $contact_number ); ?></a></li>
<?php endif; ?>
</ul>
</div><!-- #quick-contact -->
<?php endif; ?>
<div id="header-search">
<?php if ( true === $show_social_in_header && has_nav_menu( 'social' ) ) : ?>
<nav id="social-navigation-header" class="so-widget-travel-eye-social" role="navigation" aria-label="<?php esc_attr_e( 'Header Social Menu', 'travel-eye' ); ?>">
<?php
wp_nav_menu( array(
'theme_location' => 'social',
'menu_class' => 'social-links size-medium',
'container' => '',
'depth' => 1,
'fallback_cb' => false,
'link_before' => '<span class="screen-reader-text">',
'link_after' => '</span>',
) );
?>
</nav><!-- #social-navigation-header -->
<?php endif; ?>
<div class="right-bar">
<?php get_search_form(); ?>
<?php if( class_exists('woocommerce') ) :
?>
<li class="fa fa-cart cart-icon"><a href="<?php echo esc_url( wc_get_cart_url() ); ?>"></a></li>
<?php
endif; ?>
</div>
</div><!-- #header-search -->
</div>
</div><!-- #top-header -->
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment