SHARE
TWEET

liad

zivit-drori Jan 21st, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /**
  3.  * Main Header Layout
  4.  *
  5.  * @package OceanWP WordPress theme
  6.  */
  7.  
  8. // Exit if accessed directly
  9. if ( ! defined( 'ABSPATH' ) ) {
  10.     exit;
  11. }
  12.  
  13. // Header style
  14. $header_style = oceanwp_header_style();
  15.  
  16. // Header height, used for local scrolling
  17. $header_height = get_theme_mod( 'ocean_header_height', '74' );
  18.  
  19. if ( class_exists( 'Ocean_Sticky_Header' ) ) {
  20.  
  21.     if ( 'shrink' == get_theme_mod( 'osh_sticky_header_style', 'shrink' ) ) {
  22.         $header_height = get_theme_mod( 'osh_shrink_header_height', '54' );
  23.     }
  24.  
  25. }
  26.  
  27. // If vertical header style
  28. if ( 'vertical' == $header_style ) {
  29.     $header_height = 0;
  30. }
  31.  
  32. // Add container class if the header is not full width
  33. $class = '';
  34. if ( true != get_theme_mod( 'ocean_header_full_width', false ) )  {
  35.     $class = ' container';
  36. }
  37.  
  38. do_action( 'ocean_before_header' );
  39.  
  40. // If transparent header style
  41. if ( 'transparent' == $header_style
  42.     || ( 'full_screen' == $header_style && true == get_theme_mod( 'ocean_full_screen_header_transparent', false ) )
  43.         || ( 'center' == $header_style && true == get_theme_mod( 'ocean_center_header_transparent', false ) )
  44.         || ( 'medium' == $header_style && true == get_theme_mod( 'ocean_medium_header_transparent', false ) ) ) { ?>
  45.     <div id="transparent-header-wrap" class="clr">
  46. <?php
  47. } ?>
  48.  
  49. <header id="site-header" class="<?php echo esc_attr( oceanwp_header_classes() ); ?>" data-height="<?php echo esc_attr( $header_height ); ?>"<?php oceanwp_schema_markup( 'header' ); ?>>
  50.  
  51.     <?php
  52.     // Elementor `header` location
  53.     if ( ! function_exists( 'elementor_theme_do_location' ) || ! elementor_theme_do_location( 'header' ) ) { ?>
  54.  
  55.         <?php
  56.         // If header video
  57.         if ( function_exists( 'has_header_video' ) && has_header_video() ) { ?>
  58.             <div class="custom-header-media">
  59.                 <?php the_custom_header_markup(); ?>
  60.             </div>
  61.         <?php
  62.         }
  63.  
  64.         // If top header style
  65.         if ( 'top' == $header_style ) {
  66.             get_template_part( 'partials/header/style/top-header' );
  67.         }
  68.  
  69.         // If full screen header style
  70.         else if ( 'full_screen' == $header_style ) {
  71.             get_template_part( 'partials/header/style/full-screen-header' );
  72.         }
  73.  
  74.         // If center header style
  75.         else if ( 'center' == $header_style ) {
  76.             get_template_part( 'partials/header/style/center-header' );
  77.         }
  78.  
  79.         // If medium header style
  80.         else if ( 'medium' == $header_style ) {
  81.             get_template_part( 'partials/header/style/medium-header' );
  82.         }
  83.  
  84.         // If vertical header style
  85.         else if ( 'vertical' == $header_style ) {
  86.             get_template_part( 'partials/header/style/vertical-header' );
  87.         }
  88.  
  89.         // If custom header style
  90.         else if ( 'custom' == $header_style ) {
  91.             get_template_part( 'partials/header/style/custom-header' );
  92.         }
  93.  
  94.         // Default header style
  95.         else { ?>
  96.  
  97.             <?php do_action( 'ocean_before_header_inner' ); ?>
  98.  
  99.             <div id="site-header-inner" class="clr<?php echo esc_attr( $class ); ?>">
  100.  
  101.                 <?php do_action( 'ocean_header_inner_left_content' ); ?>
  102.  
  103.                 <?php do_action( 'ocean_header_inner_middle_content' ); ?>
  104.  
  105.                 <?php do_action( 'ocean_header_inner_right_content' ); ?>
  106.  
  107.             </div><!-- #site-header-inner -->
  108.  
  109.             <?php get_template_part( 'partials/mobile/mobile-dropdown' ); ?>
  110.  
  111.             <?php do_action( 'ocean_after_header_inner' ); ?>
  112.  
  113.         <?php
  114.         } ?>
  115.  
  116.         <?php
  117.         // If header media
  118.         if ( has_header_image() ) { ?>
  119.             <div class="overlay-header-media"></div>
  120.         <?php
  121.         } ?>
  122.        
  123.     <?php
  124.     } ?>
  125.  
  126. </header><!-- #site-header -->
  127.  
  128. <?php
  129. // If transparent header style
  130. if ( 'transparent' == $header_style
  131.     || ( 'full_screen' == $header_style && true == get_theme_mod( 'ocean_full_screen_header_transparent', false ) )
  132.         || ( 'center' == $header_style && true == get_theme_mod( 'ocean_center_header_transparent', false ) )
  133.         || ( 'medium' == $header_style && true == get_theme_mod( 'ocean_medium_header_transparent', false ) ) ) { ?>
  134.     </div>
  135. <?php
  136. }
  137.  
  138. do_action( 'ocean_after_header' ); ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top