header.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <?php
  2. /**
  3. * The header for our theme.
  4. *
  5. * This is the template that displays all of the <head> section and everything up until <div id="content">
  6. *
  7. * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
  8. *
  9. * @package Pen
  10. */
  11. ob_start();
  12. ?>
  13. <!--
  14. i.
  15. Ui
  16. :
  17. .r.
  18. .rJ1UusJUuY:
  19. .sjuJ11 12jjLujr
  20. :IKMBBBB BBBBQbUs
  21. gBBBgZg ZggMBBQJ
  22. QQ 单身可撩速来哦 BBQr
  23. :YBB 单纯稳重最幸福 DK
  24. XIgBZdZ iEBBBKb.
  25. :LuBBBRgMBB BBBQQBBBB.
  26. YBQBBBQBB BBBBBBBQ.
  27. :SdQBBQBBBBBMDKs
  28. :rvYuJusJLvi.
  29. :::::: ..::::.. .i:i::
  30. :i: liuyuqi.gov@msn.cn i:i:.
  31. .. .:...::::::ir...
  32. .:.i7iLsvsr:r
  33. i:iiii77Jir:
  34. :.... .:::
  35. :rv:ir:..
  36. .. .....
  37. .
  38. JUS
  39. :gv
  40. r
  41. -->
  42. <!doctype html>
  43. <html class="no-js">
  44. <head>
  45. <meta charset="utf-8">
  46. <meta name="viewport" content="width=device-width, initial-scale=1">
  47. <meta name="author" content="liuyuqi.gov@msn.cn">
  48. <meta name="keywords" content="天问博客,大数据,开发架构,随笔,行业分析,芝舟科技"/>
  49. <meta name="description" content="天问的个人博客,专注前沿科技动态。分享概率论,数学分析,运筹学,以及机器学习/深度学习/大数据和人工智能前沿知识。分享诸如餐饮管理,人事管理,tms,库存管理,订单管理,电商等软件项目解决方案。">
  50. <?php
  51. wp_head();
  52. ?>
  53. </head>
  54. <body <?php body_class(); ?>>
  55. <div id="page" class="site">
  56. <div class="pen_wrapper">
  57. <?php
  58. if ( ! is_customize_preview() ) {
  59. pen_html_jump_menu( 'color_schemes' );
  60. }
  61. ?>
  62. <a class="screen-reader-shortcut screen-reader-text" href="#content">
  63. <?php
  64. esc_html_e( 'Skip to content', 'pen' );
  65. ?>
  66. </a>
  67. <?php
  68. $header_primary = false;
  69. if ( pen_sidebar_check( 'sidebar-header-primary' ) && is_active_sidebar( 'sidebar-header-primary' ) ) {
  70. $header_primary = true;
  71. }
  72. $header_secondary = false;
  73. if ( pen_sidebar_check( 'sidebar-header-secondary' ) && is_active_sidebar( 'sidebar-header-secondary' ) ) {
  74. $header_secondary = true;
  75. }
  76. $connect = pen_html_connect( 'header' );
  77. $connect_display = 'hide';
  78. if ( $connect ) {
  79. $connect_display = 'show';
  80. }
  81. $search_html = pen_html_search_box();
  82. $search_location = '';
  83. $search_display = 'hide';
  84. $search_location = get_post_meta( get_the_ID(), 'pen_content_search_location_override', true );
  85. if ( ! $search_location || 'default' === $search_location ) {
  86. $search_location = pen_option_get( 'search_location' );
  87. }
  88. if ( $search_html ) {
  89. if ( 'header' === $search_location ) {
  90. $search_display = 'show';
  91. } elseif ( 'content' === $search_location ) {
  92. $search_display = 'show_toolbar';
  93. }
  94. }
  95. $logo = pen_html_logo();
  96. $phone = pen_option_get( 'phone' );
  97. $phone_display = ( $phone && pen_option_get( 'phone_header_display' ) ) ? 'show' : 'hide';
  98. ob_start( 'trim' );
  99. get_template_part( 'partials/site', 'navigation' );
  100. $navigation = ob_get_clean();
  101. $classes_header = array(
  102. 'site-header',
  103. $logo ? 'pen_has_logo' : '',
  104. $navigation ? 'pen_navigation_show' : 'pen_navigation_hide',
  105. 'pen_phone_' . sanitize_html_class( $phone_display ),
  106. 'pen_connect_' . sanitize_html_class( $connect_display ),
  107. 'pen_search_' . sanitize_html_class( $search_display ),
  108. 'pen_navigation_' . sanitize_html_class( pen_option_get( 'navigation_display' ) ? 'show' : 'hide' ),
  109. 'pen_navigation_mobile_' . sanitize_html_class( pen_option_get( 'navigation_mobile_display' ) ? 'show' : 'hide' ),
  110. );
  111. $classes_header = trim( implode( ' ', array_filter( $classes_header ) ) );
  112. ?>
  113. <header id="pen_header" class="<?php echo esc_attr( $classes_header ); ?>" role="banner">
  114. <div class="pen_header_inner">
  115. <div class="pen_header_main">
  116. <div class="pen_container clearfix">
  117. <h1>
  118. <?php
  119. echo $logo; /* phpcs:ignore */
  120. get_template_part( 'partials/site', 'title' );
  121. ?>
  122. </h1>
  123. <?php
  124. if ( $header_primary || $header_secondary || 'show' === $phone_display || $connect || ( 'header' === $search_location && $search_html ) ) {
  125. ?>
  126. <div class="pen_header_wrap pen_animate_on_scroll pen_custom_animation_fadeIn">
  127. <?php
  128. pen_sidebar_get( 'sidebar-header-primary' );
  129. if ( 'show' === $phone_display ) {
  130. ?>
  131. <div class="pen_phone <?php pen_class_animation( 'phone_header' ); /* phpcs:ignore */ ?>">
  132. <a href="tel:<?php echo esc_attr( $phone ); ?>">
  133. <?php
  134. echo esc_html( $phone );
  135. ?>
  136. </a>
  137. </div>
  138. <?php
  139. }
  140. echo $connect; /* phpcs:ignore */
  141. if ( 'header' === $search_location ) {
  142. echo $search_html; /* phpcs:ignore */
  143. }
  144. pen_sidebar_get( 'sidebar-header-secondary' );
  145. ?>
  146. </div>
  147. <?php
  148. }
  149. ?>
  150. </div>
  151. <?php
  152. pen_html_jump_menu( 'header' );
  153. ?>
  154. </div>
  155. <?php
  156. // Adds the main navigation menu.
  157. echo $navigation; /* phpcs:ignore */
  158. ?>
  159. </div><!-- .pen_header_inner -->
  160. <?php
  161. if ( $search_html && 'content' === $search_location ) {
  162. ?>
  163. <div id="pen_search">
  164. <div class="pen_container">
  165. <?php
  166. pen_sidebar_get( 'sidebar-search-top' );
  167. ?>
  168. </div>
  169. <div class="pen_container">
  170. <?php
  171. pen_sidebar_get( 'sidebar-search-left' );
  172. ?>
  173. <div id="pen_search_form">
  174. <?php
  175. echo $search_html; /* phpcs:ignore */
  176. ?>
  177. </div>
  178. <?php
  179. pen_sidebar_get( 'sidebar-search-right' );
  180. ?>
  181. </div>
  182. <div class="pen_container">
  183. <?php
  184. pen_sidebar_get( 'sidebar-search-bottom' );
  185. pen_html_jump_menu( 'search_bar' );
  186. ?>
  187. </div>
  188. </div>
  189. <?php
  190. }
  191. ?>
  192. </header>
  193. <div id="pen_section">
  194. <?php
  195. pen_sidebar_get( 'sidebar-top' );
  196. ?>
  197. <div class="pen_container">
  198. <div id="content" class="site-content clearfix">