PageRenderTime 47ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/themes/Avada/header.php

https://gitlab.com/webkod3r/tripolis
PHP | 270 lines | 229 code | 40 blank | 1 comment | 104 complexity | 685efd9761ba5d60b71f16dad4c4d2b5 MD5 | raw file
  1. <!DOCTYPE html>
  2. <?php global $woocommerce; ?>
  3. <html class="<?php echo ( ! Avada()->settings->get( 'smooth_scrolling' ) ) ? 'no-overflow-y' : ''; ?>" <?php language_attributes(); ?>>
  4. <head>
  5. <?php if ( isset( $_SERVER['HTTP_USER_AGENT'] ) && ( false !== strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) ) ) : ?>
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  7. <?php endif; ?>
  8. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  9. <?php
  10. if ( ! function_exists( '_wp_render_title_tag' ) ) {
  11. function avada_render_title() {
  12. ?>
  13. <title><?php wp_title( '' ); ?></title>
  14. <?php
  15. }
  16. add_action( 'wp_head', 'avada_render_title' );
  17. }
  18. ?>
  19. <!--[if lte IE 8]>
  20. <script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/assets/js/html5shiv.js"></script>
  21. <![endif]-->
  22. <?php $isiPad = (bool) strpos( $_SERVER['HTTP_USER_AGENT'],'iPad' ); ?>
  23. <?php
  24. $viewport = '';
  25. if ( Avada()->settings->get( 'responsive' ) && $isiPad ) {
  26. $viewport = '<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />';
  27. } else if( Avada()->settings->get( 'responsive' ) ) {
  28. if ( Avada()->settings->get( 'mobile_zoom' ) ) {
  29. $viewport .= '<meta name="viewport" content="width=device-width, initial-scale=1" />';
  30. } else {
  31. $viewport .= '<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />';
  32. }
  33. }
  34. $viewport = apply_filters( 'avada_viewport_meta', $viewport );
  35. echo $viewport;
  36. ?>
  37. <?php if ( Avada()->settings->get( 'favicon' ) ) : ?>
  38. <link rel="shortcut icon" href="<?php echo Avada()->settings->get( 'favicon' ); ?>" type="image/x-icon" />
  39. <?php endif; ?>
  40. <?php if ( Avada()->settings->get( 'iphone_icon' ) ) : ?>
  41. <!-- For iPhone -->
  42. <link rel="apple-touch-icon-precomposed" href="<?php echo Avada()->settings->get( 'iphone_icon' ); ?>">
  43. <?php endif; ?>
  44. <?php if ( Avada()->settings->get( 'iphone_icon_retina' ) ) : ?>
  45. <!-- For iPhone 4 Retina display -->
  46. <link rel="apple-touch-icon-precomposed" sizes="114x114" href="<?php echo Avada()->settings->get( 'iphone_icon_retina' ); ?>">
  47. <?php endif; ?>
  48. <?php if ( Avada()->settings->get( 'ipad_icon' ) ) : ?>
  49. <!-- For iPad -->
  50. <link rel="apple-touch-icon-precomposed" sizes="72x72" href="<?php echo Avada()->settings->get( 'ipad_icon' ); ?>">
  51. <?php endif; ?>
  52. <?php if ( Avada()->settings->get( 'ipad_icon_retina' ) ) : ?>
  53. <!-- For iPad Retina display -->
  54. <link rel="apple-touch-icon-precomposed" sizes="144x144" href="<?php echo Avada()->settings->get( 'ipad_icon_retina' ); ?>">
  55. <?php endif; ?>
  56. <?php wp_head(); ?>
  57. <?php
  58. $object_id = get_queried_object_id();
  59. $c_pageID = Avada::c_pageID();
  60. ?>
  61. <!--[if lte IE 8]>
  62. <script type="text/javascript">
  63. jQuery(document).ready(function() {
  64. var imgs, i, w;
  65. var imgs = document.getElementsByTagName( 'img' );
  66. for( i = 0; i < imgs.length; i++ ) {
  67. w = imgs[i].getAttribute( 'width' );
  68. imgs[i].removeAttribute( 'width' );
  69. imgs[i].removeAttribute( 'height' );
  70. }
  71. });
  72. </script>
  73. <script src="<?php echo get_template_directory_uri(); ?>/assets/js/excanvas.js"></script>
  74. <![endif]-->
  75. <!--[if lte IE 9]>
  76. <script type="text/javascript">
  77. jQuery(document).ready(function() {
  78. // Combine inline styles for body tag
  79. jQuery('body').each( function() {
  80. var combined_styles = '<style type="text/css">';
  81. jQuery( this ).find( 'style' ).each( function() {
  82. combined_styles += jQuery(this).html();
  83. jQuery(this).remove();
  84. });
  85. combined_styles += '</style>';
  86. jQuery( this ).prepend( combined_styles );
  87. });
  88. });
  89. </script>
  90. <![endif]-->
  91. <script type="text/javascript">
  92. var doc = document.documentElement;
  93. doc.setAttribute('data-useragent', navigator.userAgent);
  94. </script>
  95. <?php echo Avada()->settings->get( 'google_analytics' ); ?>
  96. <?php echo Avada()->settings->get( 'space_head' ); ?>
  97. </head>
  98. <?php
  99. $wrapper_class = '';
  100. if ( is_page_template( 'blank.php' ) ) {
  101. $wrapper_class = 'wrapper_blank';
  102. }
  103. if ( 'modern' == Avada()->settings->get( 'mobile_menu_design' ) ) {
  104. $mobile_logo_pos = strtolower( Avada()->settings->get( 'logo_alignment' ) );
  105. if ( 'center' == strtolower( Avada()->settings->get( 'logo_alignment' ) ) ) {
  106. $mobile_logo_pos = 'left';
  107. }
  108. }
  109. ?>
  110. <body <?php body_class(); ?>>
  111. <?php do_action( 'avada_before_body_content' ); ?>
  112. <?php $boxed_side_header_right = false; ?>
  113. <?php if ( ( ( 'Boxed' == Avada()->settings->get( 'layout' ) && ( 'default' == get_post_meta( $c_pageID, 'pyre_page_bg_layout', true ) || '' == get_post_meta( $c_pageID, 'pyre_page_bg_layout', true ) ) ) || 'boxed' == get_post_meta( $c_pageID, 'pyre_page_bg_layout', true ) ) && 'Top' != Avada()->settings->get( 'header_position' ) ) : ?>
  114. <?php if ( Avada()->settings->get( 'slidingbar_widgets' ) && ! is_page_template( 'blank.php' ) && ( 'Right' == Avada()->settings->get( 'header_position' ) || 'Left' == Avada()->settings->get( 'header_position' ) ) ) : ?>
  115. <?php get_template_part( 'slidingbar' ); ?>
  116. <?php $boxed_side_header_right = true; ?>
  117. <?php endif; ?>
  118. <div id="boxed-wrapper">
  119. <?php endif; ?>
  120. <div id="wrapper" class="<?php echo $wrapper_class; ?>">
  121. <div id="home" style="position:relative;top:1px;"></div>
  122. <?php if ( Avada()->settings->get( 'slidingbar_widgets' ) && ! is_page_template( 'blank.php' ) && ! $boxed_side_header_right ) : ?>
  123. <?php get_template_part( 'slidingbar' ); ?>
  124. <?php endif; ?>
  125. <?php if ( false !== strpos( Avada()->settings->get( 'footer_special_effects' ), 'footer_sticky' ) ) : ?>
  126. <div class="above-footer-wrapper">
  127. <?php endif; ?>
  128. <?php avada_header_template( 'Below' ); ?>
  129. <?php if ( 'Left' == Avada()->settings->get( 'header_position' ) || 'Right' == Avada()->settings->get( 'header_position' ) ) : ?>
  130. <?php avada_side_header(); ?>
  131. <?php endif; ?>
  132. <div id="sliders-container">
  133. <?php
  134. if ( is_search() ) {
  135. $slider_page_id = '';
  136. } else {
  137. $slider_page_id = '';
  138. if ( ! is_home() && ! is_front_page() && ! is_archive() && isset( $object_id ) ) {
  139. $slider_page_id = $object_id;
  140. }
  141. if ( ! is_home() && is_front_page() && isset( $object_id ) ) {
  142. $slider_page_id = $object_id;
  143. }
  144. if ( is_home() && ! is_front_page() ) {
  145. $slider_page_id = get_option( 'page_for_posts' );
  146. }
  147. if ( class_exists( 'WooCommerce' ) && is_shop() ) {
  148. $slider_page_id = get_option( 'woocommerce_shop_page_id' );
  149. }
  150. if ( ( get_post_status( $slider_page_id ) == 'publish' && ! post_password_required() ) ||
  151. ( get_post_status( $slider_page_id ) == 'private' && current_user_can( 'read_private_pages' ) )
  152. ) {
  153. avada_slider( $slider_page_id );
  154. }
  155. } ?>
  156. </div>
  157. <?php if ( get_post_meta( $slider_page_id, 'pyre_fallback', true ) ) : ?>
  158. <div id="fallback-slide">
  159. <img src="<?php echo get_post_meta( $slider_page_id, 'pyre_fallback', true ); ?>" alt="" />
  160. </div>
  161. <?php endif; ?>
  162. <?php avada_header_template( 'Above' ); ?>
  163. <?php if ( has_action( 'avada_override_current_page_title_bar' ) ) : ?>
  164. <?php do_action( 'avada_override_current_page_title_bar', $c_pageID ); ?>
  165. <?php else : ?>
  166. <?php avada_current_page_title_bar( $c_pageID ); ?>
  167. <?php endif; ?>
  168. <?php if ( is_page_template( 'contact.php' ) && Avada()->settings->get( 'recaptcha_public' ) && Avada()->settings->get( 'recaptcha_private' ) ) : ?>
  169. <script type="text/javascript">var RecaptchaOptions = { theme : '<?php echo Avada()->settings->get( 'recaptcha_color_scheme' ); ?>' };</script>
  170. <?php endif; ?>
  171. <?php if ( is_page_template( 'contact.php' ) && Avada()->settings->get( 'gmap_address' ) && ! Avada()->settings->get( 'status_gmap' ) ) : ?>
  172. <?php
  173. $map_popup = ( ! Avada()->settings->get( 'map_popup' ) ) ? 'yes' : 'no';
  174. $map_scrollwheel = ( ! Avada()->settings->get( 'map_scrollwheel' ) ) ? 'yes' : 'no';
  175. $map_scale = ( ! Avada()->settings->get( 'map_scale' ) ) ? 'yes' : 'no';
  176. $map_zoomcontrol = ( ! Avada()->settings->get( 'map_zoomcontrol' ) ) ? 'yes' : 'no';
  177. $address_pin = ( ! Avada()->settings->get( 'map_pin' ) ) ? 'yes' : 'no';
  178. $address_pin_animation = ( Avada()->settings->get( 'gmap_pin_animation' ) ) ? 'yes' : 'no';
  179. ?>
  180. <div id="fusion-gmap-container">
  181. <?php echo Avada()->google_map->render_map( array( 'address' => Avada()->settings->get( 'gmap_address' ), 'type' => Avada()->settings->get( 'gmap_type' ), 'address_pin' => $address_pin, 'animation' => $address_pin_animation, 'map_style' => Avada()->settings->get( 'map_styling' ), 'overlay_color' => Avada()->settings->get( 'map_overlay_color' ), 'infobox' => Avada()->settings->get( 'map_infobox_styling' ), 'infobox_background_color' => Avada()->settings->get( 'map_infobox_bg_color' ), 'infobox_text_color' => Avada()->settings->get( 'map_infobox_text_color' ), 'infobox_content' => htmlentities( Avada()->settings->get( 'map_infobox_content' ) ), 'icon' => Avada()->settings->get( 'map_custom_marker_icon' ), 'width' => Avada()->settings->get( 'gmap_width' ), 'height' => Avada()->settings->get( 'gmap_height' ), 'zoom' => Avada()->settings->get( 'map_zoom_level' ), 'scrollwheel' => $map_scrollwheel, 'scale' => $map_scale, 'zoom_pancontrol' => $map_zoomcontrol, '"popup' => $map_popup ) ); ?>
  182. </div>
  183. <?php endif; ?>
  184. <?php if ( is_page_template( 'contact-2.php' ) && Avada()->settings->get( 'gmap_address' ) && ! Avada()->settings->get( 'status_gmap' ) ) : ?>
  185. <?php
  186. $map_popup = ( Avada()->settings->get( 'map_popup' ) ) ? 'yes' : 'no';
  187. $map_scrollwheel = ( ! Avada()->settings->get( 'map_scrollwheel' ) ) ? 'yes' : 'no';
  188. $map_scale = ( ! Avada()->settings->get( 'map_scale' ) ) ? 'yes' : 'no';
  189. $map_zoomcontrol = ( ! Avada()->settings->get( 'map_zoomcontrol' ) ) ? 'yes' : 'no';
  190. $address_pin_animation = ( Avada()->settings->get( 'gmap_pin_animation' ) ) ? 'yes' : 'no';
  191. ?>
  192. <div id="fusion-gmap-container">
  193. <?php echo Avada()->google_map->render_map( array( 'address' => Avada()->settings->get( 'gmap_address' ), 'type' => Avada()->settings->get( 'gmap_type' ), 'map_style' => Avada()->settings->get( 'map_styling' ), 'animation' => $address_pin_animation, 'overlay_color' => Avada()->settings->get( 'map_overlay_color' ), 'infobox' => Avada()->settings->get( 'map_infobox_styling' ), 'infobox_background_color' => Avada()->settings->get( 'map_infobox_bg_color' ), 'infobox_text_color' => Avada()->settings->get( 'map_infobox_text_color' ), 'infobox_content' => htmlentities( Avada()->settings->get( 'map_infobox_content' ) ), 'icon' => Avada()->settings->get( 'map_custom_marker_icon' ), 'width' => Avada()->settings->get( 'gmap_width' ), 'height' => Avada()->settings->get( 'gmap_height' ), 'zoom' => Avada()->settings->get( 'map_zoom_level' ), 'scrollwheel' => $map_scrollwheel, 'scale' => $map_scale, 'zoom_pancontrol' => $map_zoomcontrol, '"popup' => $map_popup ) ); ?>
  194. </div>
  195. <?php endif; ?>
  196. <?php
  197. $main_css = '';
  198. $row_css = '';
  199. $main_class = '';
  200. $page_template = '';
  201. if ( function_exists( 'is_woocommerce' ) && is_woocommerce() ) {
  202. $custom_fields = get_post_custom_values( '_wp_page_template', $c_pageID );
  203. $page_template = ( is_array( $custom_fields ) && ! empty( $custom_fields ) ) ? $custom_fields[0] : '';
  204. }
  205. if ( get_post_type( $c_pageID ) == 'tribe_events' && tribe_get_option( 'tribeEventsTemplate', 'default' ) == '100-width.php' ) {
  206. $page_template = '100-width.php';
  207. }
  208. if (
  209. is_page_template( '100-width.php' ) ||
  210. is_page_template( 'blank.php' ) ||
  211. '100-width.php' == $page_template ||
  212. ( ( '1' == fusion_get_option( 'portfolio_width_100', 'portfolio_width_100', $c_pageID ) || 'yes' == fusion_get_option( 'portfolio_width_100', 'portfolio_width_100', $c_pageID ) ) && ( 'avada_portfolio' == get_post_type( $c_pageID ) ) ) ||
  213. ( ( '1' == fusion_get_option( 'blog_width_100', 'portfolio_width_100', $c_pageID ) || 'yes' == fusion_get_option( 'blog_width_100', 'portfolio_width_100', $c_pageID ) ) && ( 'post' == get_post_type( $c_pageID ) ) ) ||
  214. ( 'yes' == fusion_get_page_option( 'portfolio_width_100', $c_pageID ) && ( 'post' != get_post_type( $c_pageID ) && 'avada_portfolio' != get_post_type( $c_pageID ) ) ) ||
  215. ( avada_is_portfolio_template() && 'yes' == get_post_meta( $c_pageID, 'pyre_portfolio_width_100', true ) )
  216. ) {
  217. $main_css = 'padding-left:0px;padding-right:0px;';
  218. if ( Avada()->settings->get( 'hundredp_padding' ) && ! get_post_meta( $c_pageID, 'pyre_hundredp_padding', true ) ) {
  219. $main_css = 'padding-left:' . Avada()->settings->get( 'hundredp_padding' ) . ';padding-right:' . Avada()->settings->get( 'hundredp_padding' );
  220. }
  221. if ( get_post_meta( $c_pageID, 'pyre_hundredp_padding', true ) ) {
  222. $main_css = 'padding-left:' . get_post_meta( $c_pageID, 'pyre_hundredp_padding', true ) . ';padding-right:' . get_post_meta( $c_pageID, 'pyre_hundredp_padding', true );
  223. }
  224. $row_css = 'max-width:100%;';
  225. $main_class = 'width-100';
  226. }
  227. do_action( 'avada_before_main_container' );
  228. ?>
  229. <div id="main" class="clearfix <?php echo $main_class; ?>" style="<?php echo $main_css; ?>">
  230. <div class="fusion-row" style="<?php echo $row_css; ?>">