Advertisement
Guest User

Untitled

a guest
Oct 18th, 2022
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.57 KB | None | 0 0
  1. <?php
  2. $arilewp_main_header_style = get_theme_mod('arilewp_main_header_style', 'standard');
  3. $arilewp_menu_style = get_theme_mod('arilewp_menu_style', 'sticky');
  4. $arilewp_menu_container_size = get_theme_mod('arilewp_menu_container_size', 'container-full');
  5. $arilewp_cart_icon_disabled = get_theme_mod('arilewp_cart_icon_disabled', true);
  6. $arilewp_search_icon_disabled = get_theme_mod('arilewp_search_icon_disabled', true);
  7. $arilewp_quote_button_disabled = get_theme_mod('arilewp_quote_button_disabled', true);
  8. $arilewp_quote_button_text = get_theme_mod('arilewp_quote_button_text', 'Get a Quote');
  9. $arilewp_quote_button_link = get_theme_mod('arilewp_quote_button_link', '#');
  10. $arilewp_quote_button_open_new_tab_disabled = get_theme_mod('arilewp_quote_button_open_new_tab_disabled', true);
  11. if($arilewp_quote_button_open_new_tab_disabled == true):
  12. $button_target = 'target="_blank"';
  13. else: $button_target = ''; endif;
  14. ?>
  15.  
  16. <?php if($arilewp_main_header_style != 'center_logo'){ ?>
  17. <!-- Navbar -->
  18. <nav class="navbar navbar-expand-lg not-sticky navbar-light<?php if($arilewp_main_header_style == 'overlap_classic'){ echo ' navbar-header-wrap classic-header'; }?><?php if($arilewp_main_header_style == 'transparent' && is_page_template('page-templates/frontpage.php')){ echo ' navbar-header-wrap'; }?> <?php if($arilewp_menu_style == 'sticky'){echo 'header-sticky'; }?>">
  19. <div class="<?php echo $arilewp_menu_container_size; ?>">
  20. <div class="row align-self-center">
  21.  
  22. <div class="align-self-center">
  23. <?php echo arilewp_header_logo(); ?>
  24. <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
  25. <span class="navbar-toggler-icon"></span>
  26. </button>
  27. </div>
  28.  
  29. <?php
  30. $wooshop_cart = '<ul class="%2$s">%3$s';
  31.  
  32. $wooshop_cart .= '<div class="themes-header-top">';
  33.  
  34. if($arilewp_cart_icon_disabled == true):
  35.  
  36. if ( class_exists( 'WooCommerce' ) ) {
  37. $wooshop_cart .= '<div class="woo-cart-block float-left">';
  38.  
  39. global $woocommerce;
  40. $link = function_exists( 'wc_get_cart_url' ) ? wc_get_cart_url() : $woocommerce->cart->get_cart_url();
  41. $wooshop_cart .= '<a class="cart-icon" href="'.$link.'" >';
  42. if ($woocommerce->cart->cart_contents_count == 0){
  43. $wooshop_cart .= '<i class="fa fa-shopping-basket" aria-hidden="true"></i>';
  44. }else{
  45. $wooshop_cart .= '<i class="fa fa-shopping-basket" aria-hidden="true"></i>'; }
  46. $wooshop_cart .= '</a>';
  47. $wooshop_cart .= '<a href="'.$link.'" ><span class="cart-total">
  48. '.sprintf(_n('%d item', $woocommerce->cart->cart_contents_count, 'arilewp'), $woocommerce->cart->cart_contents_count).'</span></a>'; $wooshop_cart .= '</div>'; }
  49. endif;
  50. if($arilewp_search_icon_disabled == true):
  51. $wooshop_cart .= '<div class="theme-search-block float-left">';
  52. $wooshop_cart .= '<a href="#search-popup"><i class="fa fa-search"></i></a>';
  53. $wooshop_cart .= '</div>';
  54. endif;
  55. if($arilewp_quote_button_disabled == true):
  56. if ( !is_user_logged_in() ) {
  57. $wooshop_cart .= '<div class="pl-4 float-left">';
  58. $wooshop_cart .= '<a href="'.$arilewp_quote_button_link.'" '.$button_target.' class="btn-ex-small btn-border">'.$arilewp_quote_button_text.'</a>';
  59. }
  60. endif;
  61. $wooshop_cart .= '</ul>';
  62. ?>
  63. <?php
  64. wp_nav_menu( array(
  65. 'theme_location' => 'primary',
  66. 'container' => 'div',
  67. 'container_class' => 'collapse navbar-collapse',
  68. 'container_id' => 'navbarNavDropdown',
  69. 'menu_class' => 'nav navbar-nav m-right-auto',
  70. 'fallback_cb' => 'wp_bootstrap_navwalker::fallback',
  71. 'items_wrap' => $wooshop_cart,
  72. 'walker' => new wp_bootstrap_navwalker()
  73. ) );
  74.  
  75. ?>
  76.  
  77. </div>
  78. </div>
  79. </nav>
  80. <!-- /End of Navbar -->
  81.  
  82. <?php } ?>
  83.  
  84. <?php if($arilewp_main_header_style == 'center_logo'){ ?>
  85.  
  86. <!-- Header Center Logo -->
  87. <section class="theme-header-logo-center">
  88. <div class="container">
  89. <div class="row">
  90. <div class="col-lg-12 col-md-12 col-sm-12">
  91.  
  92. <?php echo arilewp_header_logo(); ?>
  93.  
  94. </div>
  95. </div>
  96. </div>
  97. </section>
  98. <!-- /End of Header Center Logo -->
  99.  
  100.  
  101. <!-- Navbar Header Center -->
  102. <nav class="navbar navbar-expand-lg not-sticky navbar-light navbar-header-center <?php if($arilewp_menu_style == 'sticky'){echo 'header-sticky'; }?>">
  103. <div class="<?php echo $arilewp_menu_container_size; ?>">
  104. <div class="row align-self-center">
  105.  
  106. <div class="align-self-center">
  107. <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
  108. <span class="navbar-toggler-icon"></span>
  109. </button>
  110. </div>
  111.  
  112. <?php
  113. $wooshop_cart = '<ul class="%2$s">%3$s';
  114.  
  115. $wooshop_cart .= '<div class="themes-header-top">';
  116.  
  117. if($arilewp_cart_icon_disabled == true):
  118.  
  119. if ( class_exists( 'WooCommerce' ) ) {
  120. $wooshop_cart .= '<div class="woo-cart-block float-left">';
  121.  
  122. global $woocommerce;
  123. $link = function_exists( 'wc_get_cart_url' ) ? wc_get_cart_url() : $woocommerce->cart->get_cart_url();
  124. $wooshop_cart .= '<a class="cart-icon" href="'.$link.'" >';
  125. if ($woocommerce->cart->cart_contents_count == 0){
  126. $wooshop_cart .= '<i class="fa fa-shopping-basket" aria-hidden="true"></i>';
  127. }else{
  128. $wooshop_cart .= '<i class="fa fa-shopping-basket" aria-hidden="true"></i>'; }
  129. $wooshop_cart .= '</a>';
  130. $wooshop_cart .= '<a href="'.$link.'" ><span class="cart-total">
  131. '.sprintf(_n('%d item', $woocommerce->cart->cart_contents_count, 'arilewp'), $woocommerce->cart->cart_contents_count).'</span></a>'; $wooshop_cart .= '</div>'; }
  132. endif;
  133. if($arilewp_search_icon_disabled == true):
  134. $wooshop_cart .= '<div class="theme-search-block float-left">';
  135. $wooshop_cart .= '<a href="#search-popup"><i class="fa fa-search"></i></a>';
  136. $wooshop_cart .= '</div>';
  137. endif;
  138. if($arilewp_quote_button_disabled == true):
  139. $wooshop_cart .= '<div class="pl-4 float-left">';
  140. $wooshop_cart .= '<a href="'.$arilewp_quote_button_link.'" '.$button_target.' class="btn-ex-small btn-border">'.$arilewp_quote_button_text.'</a>';
  141. endif;
  142. $wooshop_cart .= '</ul>';
  143. ?>
  144.  
  145.  
  146. <?php
  147. wp_nav_menu( array(
  148. 'theme_location' => 'primary',
  149. 'container' => 'div',
  150. 'container_class' => 'collapse navbar-collapse',
  151. 'container_id' => 'navbarNavDropdown',
  152. 'menu_class' => 'nav navbar-nav m-right-left-auto',
  153. 'fallback_cb' => 'wp_bootstrap_navwalker::fallback',
  154. 'items_wrap' => $wooshop_cart,
  155. 'walker' => new wp_bootstrap_navwalker()
  156. ) );
  157.  
  158. ?>
  159.  
  160. </div>
  161. </div>
  162. </nav>
  163. <!-- /End of Navbar Header Center -->
  164.  
  165.  
  166. <?php } ?>
  167.  
  168. <div id="search-popup">
  169. <button type="button" class="close">×</button>
  170. <form method="get" id="searchform" class="search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
  171. <input type="search" placeholder="<?php esc_attr_e( 'Search here', 'arilewp' ); ?>" name="s" id="s" />
  172. <button type="submit" class="btn btn-primary"><?php esc_html_e( 'Search', 'arilewp' ); ?></button>
  173. </form>
  174. </div>
  175.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement