Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //////////////////////////////////////////
- //ADD CUSTOM HEADER //////////////////////
- /////////////////////////////////////////
- //but first remove the original version
- function remove_interface_header_details()
- {
- remove_action('interface_header', 'interface_headercontent_details', 10);
- }
- add_action('interface_header', 'remove_interface_header_details', 9);
- /**
- * Shows Header content details
- *
- * Shows the site logo, title, description, searchbar, social icons and many more
- */
- add_action('interface_header', 'my_interface_headercontent_details', 10);
- function my_interface_headercontent_details()
- {
- ?>
- <?php
- global $interface_theme_setting_value;
- $options = $interface_theme_setting_value;
- $elements = array();
- $elements = array(
- $options['social_facebook'],
- $options['social_twitter'],
- $options['social_googleplus'],
- $options['social_pinterest'],
- $options['social_youtube'],
- $options['social_vimeo'],
- $options['social_linkedin'],
- $options['social_flickr'],
- $options['social_tumblr'],
- $options['social_rss']
- );
- $set_flags = 0;
- if (!empty($elements)) {
- foreach ($elements as $option) {
- if (!empty($option)) {
- $set_flags = 1;
- }
- else {
- $set_flags = 0;
- }
- if (1 == $set_flags) {
- break;
- }
- }
- }
- ?>
- <?php
- if (!function_exists('interface_footer_infoblog')): /**
- * This function for social links display on header
- *
- * Get links through Theme Options
- */
- function interface_footer_infoblog($set_flags, $place = '')
- {
- global $interface_theme_setting_value;
- $options = $interface_theme_setting_value;
- $interface_footer_infoblog = '';
- $place = '';
- if ($set_flags || (!empty($options['social_phone']) || !empty($options['social_email']) || !empty($options['social_location']))) {
- $interface_footer_infoblog .= '<div class="info-bar">
- <div class="container clearfix">';
- if (!empty($options['social_phone']) || !empty($options['social_email']) || !empty($options['social_location'])) {
- $interface_footer_infoblog .= '<div class="info clearfix">
- <ul>';
- if (!empty($options['social_phone'])) {
- $interface_footer_infoblog .= '<li class=' . '"phone-number"' . '><a title=' . __('" Call Us "') . ' ' . 'href=' . '"tel:';
- $interface_footer_infoblog .= preg_replace("/[^() 0-9+-]/", '', $options['social_phone']);
- $interface_footer_infoblog .= '">';
- $interface_footer_infoblog .= preg_replace("/[^() 0-9+-]/", '', $options['social_phone']);
- $interface_footer_infoblog .= '</a></li>';
- }
- if (!empty($options['social_email'])) {
- $interface_footer_infoblog .= '<li class=' . '"email"' . '><a title=' . __('" Mail Us "') . ' ' . 'href=' . '"mailto:';
- $interface_footer_infoblog .= is_email($options['social_email']);
- $interface_footer_infoblog .= '">';
- $interface_footer_infoblog .= is_email($options['social_email']);
- $interface_footer_infoblog .= '</a></li>';
- }
- if (!empty($options['social_location'])) {
- $interface_footer_infoblog .= '<li class=' . '"address"' . '>';
- $interface_footer_infoblog .= esc_attr($options['social_location']);
- $interface_footer_infoblog .= '</li>';
- }
- $interface_footer_infoblog .= '</ul>
- </div><!-- .info -->';
- }
- }
- else if ($place == "header" && $set_flags == 1)
- $interface_footer_infoblog .= '<div class="info-bar">
- <div class="container clearfix">';
- echo $interface_footer_infoblog;
- }
- endif;
- if (1 != $options['disable_top']) {
- interface_footer_infoblog($set_flags, "header");
- /****************************************************************************************/
- }
- if (!function_exists('interface_socialnetworks')): /**
- * This function for social links display on header
- *
- * Get links through Theme Options
- */
- function interface_socialnetworks($set_flags)
- {
- global $interface_theme_setting_value;
- $options = $interface_theme_setting_value;
- $interface_socialnetworks = '';
- if ((1 != $set_flags) || (1 == $set_flags)) {
- $social_links = array();
- $social_links_name = array();
- $social_links_name = array(
- __('Facebook', 'interface'), // __ double underscore gets the value for translation
- __('Twitter', 'interface'),
- __('Google Plus', 'interface'),
- __('Pinterest', 'interface'),
- __('Youtube', 'interface'),
- __('Vimeo', 'interface'),
- __('LinkedIn', 'interface'),
- __('Flickr', 'interface'),
- __('Tumblr', 'interface'),
- __('RSS', 'interface')
- );
- $social_links = array(
- 'Facebook' => 'social_facebook',
- 'Twitter' => 'social_twitter',
- 'Google-Plus' => 'social_googleplus',
- 'Pinterest' => 'social_pinterest',
- 'You-tube' => 'social_youtube',
- 'Vimeo' => 'social_vimeo',
- 'linkedin' => 'social_linkedin',
- 'Flickr' => 'social_flickr',
- 'Tumblr' => 'social_tumblr',
- 'RSS' => 'social_rss'
- );
- $i = 0;
- $a = '';
- foreach ($social_links as $key => $value) {
- if (!empty($options[$value])) {
- $a .= '<li class="' . strtolower($key) . '"><a href="' . esc_url($options[$value]) . '" title="' . sprintf(esc_attr__('%1$s on %2$s', 'interface'), get_bloginfo('name'), $social_links_name[$i]) . '" target="_blank">' . '</a></li>';
- }
- $i++;
- }
- if ($i > 0) {
- $interface_socialnetworks .= '<div class="social-profiles clearfix">
- <ul>';
- $interface_socialnetworks .= $a;
- $interface_socialnetworks .= '
- </ul>
- </div><!-- .social-profiles -->';
- }
- }
- echo $interface_socialnetworks;
- }
- endif;
- if (1 != $options['disable_top']) {
- interface_socialnetworks($set_flags);
- }
- /****************************************************************************************/
- ?>
- <?php
- if (1 != $options['disable_top'] && ($set_flags == 1 || (!empty($options['social_phone']) || !empty($options['social_email']) || !empty($options['social_location'])))) {
- ?>
- </div>
- <!-- .container -->
- </div>
- <!-- .info-bar -->
- <?php
- }
- ?>
- <?php
- $header_image = get_header_image();
- if (!empty($header_image)):
- ?>
- <a href="<?php
- echo esc_url(home_url('/'));
- ?>"><img src="<?php
- echo esc_url($header_image);
- ?>" class="header-image" width="<?php
- echo get_custom_header()->width;
- ?>" height="<?php
- echo get_custom_header()->height;
- ?>" alt="<?php
- echo esc_attr(get_bloginfo('name', 'display'));
- ?>"> </a>
- <?php
- endif;
- ?>
- <div class="hgroup-wrap">
- <div class="container clearfix">
- <section id="site-logo" class="clearfix">
- <?php
- if ($options['header_show'] != 'disable-both' && $options['header_show'] == 'header-text') {
- ?>
- <h1 id="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 id="site-description">
- <?php
- bloginfo('description');
- ?>
- </h2>
- <?php
- }
- elseif ($options['header_show'] != 'disable-both' && $options['header_show'] == 'header-logo') {
- ?>
- <h1 id="site-title"> <a href="<?php
- echo esc_url(home_url('/'));
- ?>" title="<?php
- echo esc_attr(get_bloginfo('name', 'display'));
- ?>" rel="home"> <img src="<?php
- echo $options['header_logo'];
- ?>" alt="<?php
- echo esc_attr(get_bloginfo('name', 'display'));
- ?>"> </a> </h1>
- <?php
- }
- ?>
- </section>
- <!-- #site-logo -->
- <button class="menu-toggle">Responsive Menu</button>
- <section class="hgroup-right">
- <?php
- if (has_nav_menu('primary')) { // if there is nav menu then content displayed from nav menu else from pages
- $args = array(
- 'theme_location' => 'primary',
- 'container' => '',
- 'items_wrap' => '<ul class="nav-menu">%3$s</ul>'
- );
- echo '<nav id="access" class="clearfix">';
- wp_nav_menu($args); //extract the content from apperance-> nav menu
- echo '</nav><!-- #access -->';
- }
- else { // extract the content from page menu only
- echo '<nav id="access" class="clearfix">';
- wp_page_menu(array(
- 'menu_class' => 'nav-menu'
- ));
- echo '</nav><!-- #access -->';
- }
- ?>
- <div class="search-toggle"></div>
- <!-- .search-toggle -->
- <div id="search-box" class="hide">
- <?php
- get_search_form();
- ?>
- <span class="arrow"></span> </div>
- <!-- #search-box -->
- </section>
- <!-- .hgroup-right -->
- </div>
- <!-- .container -->
- </div>
- <!-- .hgroup-wrap -->
- <?php
- if ('above-slider' == $options['slogan_position'] && (is_home() || is_front_page()))
- if (function_exists('interface_home_slogan'))
- interface_home_slogan();
- if (is_home() || is_front_page()) {
- if ("0" == $options['disable_slider']) {
- if (function_exists('interface_pass_slider_effect_cycle_parameters'))
- interface_pass_slider_effect_cycle_parameters();
- if (function_exists('interface_featured_sliders'))
- interface_featured_sliders();
- }
- }
- else {
- if (('' != interface_header_title()) || function_exists('bcn_display_list')) {
- ?>
- <div class="page-title-wrap">
- <div class="container clearfix">
- <?php
- if (function_exists('interface_breadcrumb'))
- interface_breadcrumb();
- ?>
- <h1 class="page-title"><?php
- echo interface_header_title();
- ?></h1>
- <!-- .page-title -->
- </div>
- </div>
- <?php
- }
- }
- if ('below-slider' == $options['slogan_position'] && (is_home() || is_front_page()))
- if (function_exists('interface_home_slogan'))
- interface_home_slogan();
- }
- ///////////////////////////////////////////////////////////////////////////////////
- //END CUSTOMIZED THEME HEADER ////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////////////////
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement