Instantly share code, notes, and snippets.
Created
June 7, 2022 03:33
-
Save congthien/0f78dd1594f70a5f6cb58660a9406935 to your computer and use it in GitHub Desktop.
replace wpcharming_header_default() function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wpcharming_header_default() { | |
global $wpc_option; | |
?> | |
<header id="masthead" class="site-header <?php if ( wpcharming_option('header_fixed') ) echo 'fixed-on' ?>" role="banner"> | |
<div class="header-wrap"> | |
<div class="container-fluid"> | |
<div class="site-branding"> | |
<?php if ( wpcharming_option('site_logo', false, 'url') !== '' ) { ?> | |
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"> | |
<img src="<?php echo wpcharming_logo_render(); ?>" alt="<?php get_bloginfo( 'name' ) ?>" /> | |
</a> | |
<?php } else { ?> | |
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1> | |
<h2 class="site-description"><?php bloginfo( 'description' ); ?></h2> | |
<?php } ?> | |
</div><!-- /.site-branding --> | |
<div class="header-right-wrap clearfix"> | |
<div class="header-widget"> | |
<div class="header-right-widgets clearfix"> | |
<div class="header-extract clearfix"> | |
<?php if ( isset($wpc_option['header_social']) && $wpc_option['header_social'] == true ) { ?> | |
<div class="extract-element"> | |
<div class="header-social"> | |
<?php if ( !empty( $wpc_option['header_use_social']['twitter']) && $wpc_option['header_use_social']['twitter'] == 1 && $wpc_option['twitter'] !== '' ) { ?><a target="_blank" href="<?php echo esc_url($wpc_option['twitter']); ?>" title="Twitter"><i class="fa fa-twitter"></i></a> <?php } ?> | |
<?php if ( !empty( $wpc_option['header_use_social']['facebook']) && $wpc_option['header_use_social']['facebook'] == 1 && $wpc_option['facebook'] !== '' ) { ?><a target="_blank" href="<?php echo esc_url($wpc_option['facebook']); ?>" title="Facebook"><i class="fa fa-facebook"></i></a> <?php } ?> | |
<?php if ( !empty( $wpc_option['header_use_social']['linkedin']) && $wpc_option['header_use_social']['linkedin'] == 1 && $wpc_option['linkedin'] !== '' ) { ?><a target="_blank" href="<?php echo esc_url($wpc_option['linkedin']); ?>" title="Linkedin"><i class="fa fa-linkedin-square"></i></a> <?php } ?> | |
<?php if ( !empty( $wpc_option['header_use_social']['pinterest']) && $wpc_option['header_use_social']['pinterest'] == 1 && $wpc_option['pinterest'] !== '' ) { ?><a target="_blank" href="<?php echo esc_url($wpc_option['pinterest']); ?>" title="Pinterest"><i class="fa fa-pinterest"></i></a> <?php } ?> | |
<?php if ( !empty( $wpc_option['header_use_social']['instagram']) && $wpc_option['header_use_social']['instagram'] == 1 && $wpc_option['instagram'] !== '' ) { ?><a target="_blank" href="<?php echo esc_url($wpc_option['instagram']); ?>" title="Instagram"><i class="fa fa-instagram"></i></a> <?php } ?> | |
<?php if ( !empty( $wpc_option['header_use_social']['vk']) && $wpc_option['header_use_social']['vk'] == 1 && $wpc_option['vk'] !== '' ) { ?><a target="_blank" href="<?php echo esc_url($wpc_option['vk']); ?>" title="VK"><i class="fa fa-vk"></i></a> <?php } ?> | |
<?php if ( !empty( $wpc_option['header_use_social']['yelp']) && $wpc_option['header_use_social']['yelp'] == 1 && $wpc_option['yelp'] !== '' ) { ?><a target="_blank" href="<?php echo esc_url($wpc_option['yelp']); ?>" title="Yelp"><i class="fa fa-yelp"></i></a> <?php } ?> | |
<?php if ( !empty( $wpc_option['header_use_social']['foursquare']) && $wpc_option['header_use_social']['foursquare'] == 1 && $wpc_option['foursquare'] !== '' ) { ?><a target="_blank" href="<?php echo esc_url($wpc_option['foursquare']); ?>" title="Foursquare"><i class="fa fa-foursquare"></i></a> <?php } ?> | |
<?php if ( !empty( $wpc_option['header_use_social']['flickr']) && $wpc_option['header_use_social']['flickr'] == 1 && $wpc_option['flickr'] !== '' ) { ?><a target="_blank" href="<?php echo esc_url($wpc_option['flickr']); ?>" title="Flickr"><i class="fa fa-flickr"></i></a> <?php } ?> | |
<?php if ( !empty( $wpc_option['header_use_social']['youtube']) && $wpc_option['header_use_social']['youtube'] == 1 && $wpc_option['youtube'] !== '' ) { ?><a target="_blank" href="<?php echo esc_url($wpc_option['youtube']); ?>" title="Youtube"><i class="fa fa-youtube-play"></i></a> <?php } ?> | |
<?php if ( !empty( $wpc_option['header_use_social']['email']) && $wpc_option['header_use_social']['email'] == 1 && $wpc_option['email'] !== '' ) { ?><a href="<?php echo wp_kses_post($wpc_option['email']); ?>" title="Email"><i class="fa fa-envelope"></i></a> <?php } ?> | |
<?php if ( !empty( $wpc_option['header_use_social']['rss']) && $wpc_option['header_use_social']['rss'] == 1 && $wpc_option['rss'] !== '' ) { ?><a target="_blank" href="<?php echo esc_url($wpc_option['rss']); ?>" title="RSS"><i class="fa fa-rss"></i></a> <?php } ?> | |
</div> | |
</div> | |
<?php } ?> | |
<?php if ( isset($wpc_option['extract_1_text']) || isset($wpc_option['extract_1_value']) ) { ?> | |
<div class="extract-element"> | |
<span class="header-text"><?php echo esc_attr( $wpc_option['extract_1_text'] ); ?></span> <span class="phone-text primary-color"><?php echo wp_kses_post( $wpc_option['extract_1_value'] ); ?></span> | |
</div> | |
<?php } ?> | |
<?php if ( isset($wpc_option['extract_2_text']) || isset($wpc_option['extract_2_value']) ) { ?> | |
<div class="extract-element"> | |
<span class="header-text"><?php echo esc_attr( $wpc_option['extract_2_text'] ); ?></span> <span class="phone-text primary-color"><?php echo wp_kses_post( $wpc_option['extract_2_value'] ); ?></span> | |
</div> | |
<?php } ?> | |
</div> | |
</div> | |
</div> | |
<?php if( function_exists( 'ubermenu' ) ): ?> | |
<!-- # UBERMENU MANUAL INTEGRATION CODE GOES HERE - ubermenu() --> | |
<?php ubermenu( 'main' , array( 'theme_location' => 'primary' ) ); ?> | |
<?php else: ?> | |
<!-- # THEME MENU CODE, AS IS, GOES HERE --> | |
<nav id="site-navigation" class="main-navigation" role="navigation"> | |
<div id="nav-toggle"><i class="fa fa-bars"></i></div> | |
<ul class="wpc-menu"> | |
<?php if ( has_nav_menu( 'primary' ) ) { wp_nav_menu( array('theme_location' => 'primary', 'container' => '', 'items_wrap' => '%3$s' ) ); } ?> | |
</ul> | |
</nav><!-- #site-navigation --> | |
<?php endif; ?> | |
</div> | |
</div> | |
</div> | |
</header><!-- #masthead --> | |
<?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment