Skip to content

Instantly share code, notes, and snippets.

Created August 18, 2017 11:48
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/c0fc2d48bb5bc52546818c672335b64a to your computer and use it in GitHub Desktop.
Save anonymous/c0fc2d48bb5bc52546818c672335b64a to your computer and use it in GitHub Desktop.
function education_hub_header_top_content() {
$contact_number = education_hub_get_option( 'contact_number' );
$contact_email = education_hub_get_option( 'contact_email' );
?>
<div id="tophead">
<div class="container">
<div id="quick-contact">
<?php if ( ! empty( $contact_number ) || ! empty( $contact_email ) ): ?>
<ul>
<?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 ?>
<?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 ?>
</ul>
<?php endif ?>
<?php if ( true === education_hub_get_option( 'show_notice' ) ): ?>
<div class="top-news">
<p>
<?php $notice_title = education_hub_get_option( 'notice_title' ); ?>
<?php if ( ! empty( $notice_title ) ): ?>
<span class="top-news-title"><?php echo esc_html( $notice_title ); ?></span>
<?php endif ?>
<?php $notice_link_text = education_hub_get_option( 'notice_link_text' ); ?>
<?php if ( ! empty( $notice_link_text ) ): ?>
<a href="<?php echo esc_url( education_hub_get_option( 'notice_link_url' ) ); ?>" target="_blank"><?php echo esc_html( $notice_link_text ); ?>
</a>
<?php endif ?>
</p>
</div>
<?php endif ?>
</div>
<?php if ( true === education_hub_get_option( 'show_quick_links' ) ): ?>
<div class="quick-links">
<a href="#" class="links-btn"><?php echo esc_html( education_hub_get_option( 'quick_links_text' ) ); ?></a>
<?php
wp_nav_menu(
array(
'theme_location' => 'quick-links',
'container' => false,
'depth' => 1,
'fallback_cb' => 'education_hub_quick_links_fallback',
)
);
?>
</div>
<?php endif ?>
<?php if ( true === education_hub_get_option( 'show_social_in_header' ) ) : ?>
<div class="header-social-wrapper">
<?php the_widget( 'Education_Hub_Social_Widget' ); ?>
</div><!-- .header-social-wrapper -->
<?php endif; ?>
</div> <!-- .container -->
</div><!-- #tophead -->
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment