Advertisement
Guest User

Untitled

a guest
Nov 18th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.30 KB | None | 0 0
  1. <?php
  2. global $avia_config;
  3.  
  4. $responsive = avia_get_option('responsive_active') != "disabled" ? "responsive" : "fixed_layout";
  5. $headerS = avia_header_setting();
  6. $social_args = array('outside'=>'ul', 'inside'=>'li', 'append' => '');
  7. $icons = !empty($headerS['header_social']) ? avia_social_media_icons($social_args, false) : "";
  8.  
  9. if(isset($headerS['disabled'])) return;
  10.  
  11. ?>
  12.  
  13. <header id='header' class='all_colors header_color <?php avia_is_dark_bg('header_color'); echo " ".$headerS['header_class']; ?>' <?php avia_markup_helper(array('context' => 'header','post_type'=>'forum'));?>>
  14.  
  15. <?php
  16.  
  17. if($responsive)
  18. {
  19. echo '<a id="advanced_menu_toggle" href="#" '.av_icon_string('mobile_menu').'></a>';
  20. echo '<a id="advanced_menu_hide" href="#" '.av_icon_string('close').'></a>';
  21. }
  22.  
  23.  
  24. ?>
  25. <div id='header_main' class='container_wrap container_wrap_logo'>
  26.  
  27. <?php
  28. /*
  29. * Hook that can be used for plugins and theme extensions (currently: the woocommerce shopping cart)
  30. */
  31. do_action('ava_main_header');
  32.  
  33. if($headerS['header_position'] != "header_top") do_action('ava_main_header_sidebar');
  34.  
  35.  
  36. $output .= "<div class='container av-logo-container'>";
  37.  
  38. $output .= "<div class='inner-container'>";
  39.  
  40. /*
  41. * display the theme logo by checking if the default logo was overwritten in the backend.
  42. * the function is located at framework/php/function-set-avia-frontend-functions.php in case you need to edit the output
  43. */
  44. $addition = false;
  45. if( !empty($headerS['header_transparency']) && !empty($headerS['header_replacement_logo']) )
  46. {
  47. $addition = "<img src='".$headerS['header_replacement_logo']."' class='alternate' alt='' title='' />";
  48. }
  49.  
  50. $output .= avia_logo(AVIA_BASE_URL.'images/layout/logo.png', $addition, 'strong', true);
  51.  
  52. if(!empty($headerS['bottom_menu']))
  53. {
  54. ob_start();
  55. do_action('ava_before_bottom_main_menu'); // todo: replace action with filter, might break user customizations
  56. $output .= ob_get_clean();
  57. }
  58.  
  59. if($headerS['header_social'] == 'icon_active_main' && !empty($headerS['bottom_menu']))
  60. {
  61. $output .= $icons;
  62. }
  63.  
  64.  
  65. /*
  66. * display the main navigation menu
  67. * modify the output in your wordpress admin backend at appearance->menus
  68. */
  69.  
  70. if($headerS['bottom_menu'])
  71. {
  72. $output .= "</div>";
  73. $output .= "</div>";
  74.  
  75. if( !empty( $headerS['header_menu_above'] ))
  76. {
  77. $avia_config['temp_logo_container'] = "<div class='av-section-bottom-logo header_color'>".$output."</div>";
  78. $output = "";
  79. }
  80.  
  81. $output .= "<div id='header_main_alternate' class='container_wrap'>";
  82. $output .= "<div class='container'>";
  83. }
  84.  
  85.  
  86. $output .= "<nav class='main_menu' data-selectname='".__('Select a page','avia_framework')."' ".avia_markup_helper(array('context' => 'nav', 'echo' => false)).">";
  87. $avia_theme_location = 'avia';
  88. $avia_menu_class = $avia_theme_location . '-menu';
  89. $args = array(
  90. 'theme_location' => $avia_theme_location,
  91. 'menu_id' => $avia_menu_class,
  92. 'menu_class' => 'menu av-main-nav',
  93. 'container_class' => $avia_menu_class.' av-main-nav-wrap'.$icon_beside,
  94. 'fallback_cb' => 'avia_fallback_menu',
  95. 'echo' => false,
  96. 'walker' => new avia_responsive_mega_menu()
  97. );
  98.  
  99. $main_nav = wp_nav_menu($args);
  100. $output .= $main_nav;
  101.  
  102.  
  103. /*
  104. * Hook that can be used for plugins and theme extensions
  105. */
  106. ob_start();
  107. do_action('ava_inside_main_menu'); // todo: replace action with filter, might break user customizations
  108. $output .= ob_get_clean();
  109.  
  110. if($icon_beside)
  111. {
  112. $output .= $icons;
  113. }
  114.  
  115. $output .= '</nav>';
  116.  
  117. /*
  118. * Hook that can be used for plugins and theme extensions
  119. */
  120. ob_start();
  121. do_action('ava_after_main_menu'); // todo: replace action with filter, might break user customizations
  122. $output .= ob_get_clean();
  123.  
  124. /* inner-container */
  125. $output .= "</div>";
  126.  
  127. /* end container */
  128. $output .= " </div> ";
  129.  
  130.  
  131. //output the whole menu
  132. echo $output;
  133.  
  134.  
  135. ?>
  136.  
  137. <!-- end container_wrap-->
  138. </div>
  139. <?php
  140. //subheader, only display when the user chooses a social header
  141. if($headerS['header_topbar'] == true)
  142. {
  143. ?>
  144. <div id='header_meta' class='container_wrap container_wrap_meta <?php echo avia_header_class_string(array('header_social', 'header_secondary_menu', 'header_phone_active'), 'av_'); ?>'>
  145.  
  146. <div class='container'>
  147. <?php
  148. /*
  149. * display the themes social media icons, defined in the wordpress backend
  150. * the avia_social_media_icons function is located in includes/helper-social-media-php
  151. */
  152. $nav = "";
  153.  
  154. //display icons
  155. if(strpos( $headerS['header_social'], 'extra_header_active') !== false) echo $icons;
  156.  
  157. //display navigation
  158. if(strpos( $headerS['header_secondary_menu'], 'extra_header_active') !== false )
  159. {
  160. //display the small submenu
  161. $avia_theme_location = 'avia2';
  162. $avia_menu_class = $avia_theme_location . '-menu';
  163. $args = array(
  164. 'theme_location'=>$avia_theme_location,
  165. 'menu_id' =>$avia_menu_class,
  166. 'container_class' =>$avia_menu_class,
  167. 'fallback_cb' => '',
  168. 'container'=>'',
  169. 'echo' =>false
  170. );
  171.  
  172. $nav = wp_nav_menu($args);
  173. }
  174.  
  175. if(!empty($nav) || apply_filters('avf_execute_avia_meta_header', false))
  176. {
  177. echo "<nav class='sub_menu' ".avia_markup_helper(array('context' => 'nav', 'echo' => false)).">";
  178. echo $nav;
  179. do_action('avia_meta_header'); // Hook that can be used for plugins and theme extensions (currently: the wpml language selector)
  180. echo '</nav>';
  181. }
  182.  
  183.  
  184. //phone/info text
  185. $phone = $headerS['header_phone_active'] != "" ? $headerS['phone'] : "";
  186. $phone_class = !empty($nav) ? "with_nav" : "";
  187. if($phone) { echo "<div class='phone-info {$phone_class}'><span>".do_shortcode($phone)."</span></div>"; }
  188.  
  189.  
  190. ?>
  191. </div>
  192. </div>
  193.  
  194. <?php }
  195.  
  196.  
  197.  
  198. $output = "";
  199. $temp_output = "";
  200. $icon_beside = "";
  201.  
  202. if($headerS['header_social'] == 'icon_active_main' && empty($headerS['bottom_menu']))
  203. {
  204. $icon_beside = " av_menu_icon_beside";
  205. }
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212. ?>
  213.  
  214. <div class='header_bg'></div>
  215.  
  216. <!-- end header -->
  217. </header>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement