Guest User

Untitled

a guest
Dec 24th, 2021
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.56 KB | None | 0 0
  1. <?php
  2. if( ! defined( 'ABSPATH' ) ) { die(); }
  3.  
  4. global $avia_config;
  5.  
  6. $lightbox_option = avia_get_option( 'lightbox_active' );
  7. $avia_config['use_standard_lightbox'] = empty( $lightbox_option ) || ( 'lightbox_active' == $lightbox_option ) ? 'lightbox_active' : 'disabled';
  8.  
  9. /**
  10. * Allow to overwrite the option setting for using the standard lightbox
  11. * Make sure to return 'disabled' to deactivate the standard lightbox - all checks are done against this string
  12. *
  13. * @added_by GΓΌnter
  14. * @since 4.2.6
  15. * @param string $use_standard_lightbox 'lightbox_active' | 'disabled'
  16. * @return string 'lightbox_active' | 'disabled'
  17. */
  18. $avia_config['use_standard_lightbox'] = apply_filters( 'avf_use_standard_lightbox', $avia_config['use_standard_lightbox'] );
  19.  
  20.  
  21. $style = $avia_config['box_class'];
  22. $responsive = avia_get_option( 'responsive_active' ) != 'disabled' ? 'responsive' : 'fixed_layout';
  23. $blank = isset( $avia_config['template'] ) ? $avia_config['template'] : '';
  24. $preloader = avia_get_option( 'preloader' ) == 'preloader' ? 'av-preloader-active av-preloader-enabled' : 'av-preloader-disabled';
  25.  
  26. $html_classes = array();
  27. $body_classes = array();
  28.  
  29. $html_classes[] = "html_{$style}";
  30. $html_classes[] = $responsive;
  31. $html_classes[] = $preloader;
  32. $html_classes[] = avia_header_class_filter( avia_header_class_string() );
  33. $html_classes[] = $avia_config['use_standard_lightbox'] != 'disabled' ? 'av-default-lightbox' : 'av-custom-lightbox';
  34. $html_classes[] = 'av-no-preview'; /*required for live previews*/
  35.  
  36. $body_classes[] = $style;
  37. $body_classes[] = $blank;
  38. $body_classes[] = avia_get_option( 'sidebar_styling' );
  39.  
  40. /**
  41. * Get footer stylings and post overrides
  42. */
  43. $the_id = avia_get_the_id(); //use avia get the id instead of default get id. prevents notice on 404 pages
  44. $body_layout = avia_get_option( 'color-body_style' );
  45. $footer_options = avia_get_option( 'display_widgets_socket', 'all' );
  46. $footer_behavior = avia_get_option( 'footer_behavior' );
  47. $footer_media = avia_get_option( 'curtains_media' );
  48.  
  49. $footer_post = get_post_meta( $the_id, 'footer', true );
  50. $footer_behavior_post = get_post_meta( $the_id, 'footer_behavior', true );
  51.  
  52. /**
  53. * Reset individual page override to defaults if widget or page settings are different (user might have changed theme options)
  54. * (if user wants a page as footer he must select this in main options - on individual page it's only possible to hide the page)
  55. */
  56. if( false !== strpos( $footer_options, 'page' ) )
  57. {
  58. /**
  59. * User selected a page as footer in main options
  60. */
  61. if( ! in_array( $footer_post, array( 'page_in_footer_socket', 'page_in_footer', 'nofooterarea' ) ) )
  62. {
  63. $footer_post = '';
  64. }
  65. }
  66. else
  67. {
  68. /**
  69. * User selected a widget based footer in main options
  70. */
  71. if( in_array( $footer_post, array( 'page_in_footer_socket', 'page_in_footer' ) ) )
  72. {
  73. $footer_post = '';
  74. }
  75. }
  76.  
  77. $footer_option = ! empty( $footer_post ) ? $footer_post : $footer_options;
  78.  
  79. switch ( $footer_behavior_post )
  80. {
  81. case 'scroll':
  82. $footer_behavior = '';
  83. break;
  84. case 'curtain_footer':
  85. $footer_behavior = 'curtain_footer';
  86. break;
  87. default:
  88. break;
  89. }
  90.  
  91. if( 'stretched' != $body_layout )
  92. {
  93. $footer_behavior = '';
  94. $footer_media = '';
  95. }
  96. else
  97. {
  98. if( empty( $footer_media ) )
  99. {
  100. $footer_media = '70';
  101. }
  102. }
  103.  
  104. $avia_config['footer_option'] = $footer_option;
  105. $avia_config['footer_behavior'] = $footer_behavior;
  106. $avia_config['footer_media'] = $footer_media;
  107.  
  108. /**
  109. * If title attribute is missing for an image default lightbox displays the alt attribute
  110. *
  111. * @since 4.7.6.2
  112. * @param bool
  113. * @return false|mixed anything except false will activate this feature
  114. */
  115. $body_classes[] = false !== apply_filters( 'avf_lightbox_show_alt_text', false ) ? 'avia-mfp-show-alt-text' : '';
  116.  
  117. /**
  118. * Allows to alter default settings Enfold-> Main Menu -> General -> Menu Items for Desktop
  119. * @since 4.4.2
  120. */
  121. $is_burger_menu = apply_filters( 'avf_burger_menu_active', avia_is_burger_menu(), 'header' );
  122. $html_classes[] = $is_burger_menu ? 'html_burger_menu_active' : 'html_text_menu_active';
  123.  
  124. if( ! $is_burger_menu )
  125. {
  126. $handling = avia_get_option( 'header_mobile_device_handling' );
  127. $html_classes[] = 'mobile_switch_portrait' != $handling ? 'av-mobile-menu-switch-default' : 'av-mobile-menu-switch-portrait';
  128. }
  129.  
  130. /**
  131. * Add additional custom body classes
  132. * e.g. to disable default image hover effect add av-disable-avia-hover-effect
  133. *
  134. * @since 4.4.2
  135. */
  136. $body_classes[] = apply_filters( 'avf_custom_body_classes', '' );
  137.  
  138. /**
  139. * @since 4.2.3 we support columns in rtl order (before they were ltr only). To be backward comp. with old sites use this filter.
  140. */
  141. $body_classes[] = 'yes' == apply_filters( 'avf_rtl_column_support', 'yes' ) ? 'rtl_columns' : '';
  142.  
  143. /**
  144. * @since 4.8.6.3
  145. */
  146. $body_classes[] = 'curtain_footer' == $avia_config['footer_behavior'] ? 'av-curtain-footer' : '';
  147. $body_classes[] = is_numeric( $footer_media ) || empty( $footer_media ) ? 'av-curtain-numeric' : "av-curtain-screen {$footer_media}";
  148.  
  149.  
  150. $html_classes = implode( ' ', array_unique( array_filter( $html_classes ) ) );
  151.  
  152.  
  153.  
  154. ?><!DOCTYPE html>
  155. <html <?php language_attributes(); ?> class="<?php echo $html_classes; ?>">
  156. <head>
  157. <meta charset="<?php bloginfo( 'charset' ); ?>" />
  158. <?php
  159.  
  160. /*
  161. * outputs a rel=follow or nofollow tag to circumvent google duplicate content for archives
  162. * located in framework/php/function-set-avia-frontend.php
  163. */
  164. if( function_exists( 'avia_set_follow' ) )
  165. {
  166. echo avia_set_follow();
  167. }
  168.  
  169. ?>
  170.  
  171.  
  172. <!-- mobile setting -->
  173. <?php
  174.  
  175. $meta_viewport = ( strpos( $responsive, 'responsive' ) !== false ) ? '<meta name="viewport" content="width=device-width, initial-scale=1">' : '';
  176.  
  177. /**
  178. * @since 4.7.6.4
  179. * @param string
  180. * @return string
  181. */
  182. echo apply_filters( 'avf_header_meta_viewport', $meta_viewport );
  183.  
  184. ?>
  185.  
  186.  
  187. <!-- Scripts/CSS and wp_head hook -->
  188. <?php
  189. /* Always have wp_head() just before the closing </head>
  190. * tag of your theme, or you will break many plugins, which
  191. * generally use this hook to add elements to <head> such
  192. * as styles, scripts, and meta tags.
  193. */
  194.  
  195. wp_head();
  196.  
  197. ?>
  198.  
  199. </head>
  200.  
  201. <?php
  202.  
  203.  
  204. $body_classes[] = $avia_config['font_stack'];
  205. $body_classes = implode( ' ', array_unique( array_filter( $body_classes ) ) );
  206.  
  207. ?>
  208. <body id="top" <?php body_class( $body_classes ); avia_markup_helper( array( 'context' => 'body' ) ); ?>>
  209.  
  210. <?php
  211.  
  212. /**
  213. * WP 5.2 add a new function - stay backwards compatible with older WP versions and support plugins that use this hook
  214. * https://make.wordpress.org/themes/2019/03/29/addition-of-new-wp_body_open-hook/
  215. *
  216. * @since 4.5.6
  217. */
  218. if( function_exists( 'wp_body_open' ) )
  219. {
  220. wp_body_open();
  221. }
  222. else
  223. {
  224. do_action( 'wp_body_open' );
  225. }
  226.  
  227. do_action( 'ava_after_body_opening_tag' );
  228.  
  229. if( 'av-preloader-active av-preloader-enabled' === $preloader )
  230. {
  231. echo avia_preload_screen();
  232. }
  233.  
  234. ?>
  235.  
  236. <div id='wrap_all'>
  237.  
  238. <?php
  239. if( ! $blank ) //blank templates dont display header nor footer
  240. {
  241. //fetch the template file that holds the main menu, located in includes/helper-menu-main.php
  242. get_template_part( 'includes/helper', 'main-menu' );
  243.  
  244. } ?>
  245.  
  246. <div id='main' class='all_colors' data-scroll-offset='<?php echo avia_header_setting( 'header_scroll_offset' ); ?>'>
  247.  
  248. <?php
  249.  
  250. if( isset( $avia_config['temp_logo_container'] ) )
  251. {
  252. echo $avia_config['temp_logo_container'];
  253. }
  254.  
  255. do_action( 'ava_after_main_container' );
  256.  
  257.  
Advertisement
Add Comment
Please, Sign In to add comment