PageRenderTime 62ms CodeModel.GetById 28ms RepoModel.GetById 1ms app.codeStats 0ms

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

https://bitbucket.org/geetharani/gordon
PHP | 321 lines | 237 code | 44 blank | 40 comment | 45 complexity | a1b70cfaae66cf15f90b042461cf42ec MD5 | raw file
Possible License(s): MIT
  1. <?php
  2. /**
  3. * @KingSize 2011
  4. **/
  5. ####### Theme Setting #########
  6. global $get_options,$data;
  7. $get_options = get_option('wm_theme_settings');
  8. ###############################
  9. ?>
  10. <!DOCTYPE html>
  11. <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
  12. <head> <!-- Header starts here -->
  13. <meta charset="<?php bloginfo( 'charset' ); ?>" />
  14. <title><?php bloginfo('name'); ?> | <?php is_home() || is_front_page() ? bloginfo('description') : wp_title(''); ?></title> <!-- Website Title of WordPress Blog -->
  15. <link rel="icon" type="image/png" href="<?php echo $data['wm_favicon_upload'];?>">
  16. <link rel="profile" href="http://gmpg.org/xfn/11" />
  17. <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
  18. <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'template_url' ); ?>/kingsize.css" />
  19. <!-- Style Sheet -->
  20. <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> <!-- Pingback Call -->
  21. <!--[if lte IE 8]>
  22. <link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/css/stylesIE.css" type="text/css" media="screen" />
  23. <![endif]-->
  24. <!--[if lte IE 7]>
  25. <link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/css/stylesIE7.css" type="text/css" media="screen" />
  26. <![endif]-->
  27. <!-- Include custom JS -->
  28. <?php require(TEMPLATEPATH . '/js/custom.php'); ?>
  29. <!-- End Include custom JS -->
  30. <!-- Do Not Remove the Below -->
  31. <?php if(is_singular()) wp_enqueue_script('comment-reply'); ?>
  32. <?php if ($tpl_body_id!="slideviewer") { wp_enqueue_script("jquery"); } ?>
  33. <?php wp_head(); ?>
  34. <!-- Do Not Remove the Above -->
  35. <!-- Theme setting head include wp admin -->
  36. <?php
  37. $head_include = "";
  38. $head_include = $data['wm_head_include'];
  39. echo $head_include;
  40. ?>
  41. <!-- End Theme setting head include -->
  42. <!-- Gallery / Portfolio control CSS and JS-->
  43. <?php
  44. //if gallery Shortcode is being used
  45. global $tpl_body_id;
  46. $pattern = get_shortcode_regex();
  47. /*preg_match('/'.$pattern.'/s', $posts[0]->post_content, $matches);
  48. if (is_array($matches) && $matches[2] == 'img_gallery') {
  49. $arr_type = array();
  50. $arr_type = explode(' type="',$matches[3]);
  51. list($tpl_body_id, $extra) = split('"', $arr_type[1], 2);
  52. }*/
  53. if( preg_match('/type="colorbox"(.*)/', $posts[0]->post_content, $matches) )
  54. {
  55. $tpl_body_id = "colorbox";
  56. }
  57. elseif( preg_match('/type="fancybox"(.*)/', $posts[0]->post_content, $matches) )
  58. {
  59. $tpl_body_id = "fancybox";
  60. }
  61. elseif( preg_match('/type="prettyphoto"(.*)/', $posts[0]->post_content, $matches) )
  62. {
  63. $tpl_body_id = "prettyphoto";
  64. }
  65. elseif( preg_match('/type="slideviewer"(.*)/', $posts[0]->post_content, $matches) )
  66. {
  67. $tpl_body_id = "slideviewer";
  68. }
  69. elseif( preg_match('/type="galleria"(.*)/', $posts[0]->post_content, $matches) )
  70. {
  71. $tpl_body_id = "galleria";
  72. }
  73. /*elseif($tpl_body_id != "contactpage")
  74. $tpl_body_id = "prettyphoto";*/
  75. // End if gallery shortcode being used
  76. include (TEMPLATEPATH . '/lib/gallery_template_style_js.php'); ?>
  77. <!-- END Portfolio control CSS and JS-->
  78. <?php if ( $data['wm_no_rightclick_enabled'] == "1" ) {?>
  79. <!-- Disable Right-click -->
  80. <script type="text/javascript" language="javascript">
  81. jQuery(function($) {
  82. $(this).bind("contextmenu", function(e) {
  83. e.preventDefault();
  84. });
  85. });
  86. </script>
  87. <!-- END of Disable Right-click -->
  88. <?php } ?>
  89. <?php if( $data['wm_custom_css'] ) { ?><style><?php echo $data['wm_custom_css'];?></style><?php } ?>
  90. <!-- scripts for background slider; if you want to use background slider/video be sure you have this v4-->
  91. <?php
  92. if( $data['wm_background_type'] != 'Video Background' && is_home()) {
  93. include (TEMPLATEPATH . '/lib/background_slider.php');
  94. }
  95. ?>
  96. <!-- scripts for background slider end here v4-->
  97. <!-- New Opacity/Transparency Options added in v4 -->
  98. <?php
  99. if( $data['wm_enable_opacity'] == "0.9 Opacity") { ?>
  100. <style>
  101. /*<!--- .9 --->*/
  102. #menu { background: url(<?php echo get_template_directory_uri(); ?>/images/opacity/90/menu_back.png) repeat left top !important; }
  103. #hide_menu { background: url(<?php echo get_template_directory_uri(); ?>/images/opacity/90/hide_menu_back.png) no-repeat left top !important; }
  104. #main_wrap { background: url(<?php echo get_template_directory_uri(); ?>/images/opacity/90/content_back.png) repeat left top !important; }
  105. #navbar ul { opacity: 0.9 !important; }
  106. .menu_tooltip {background: url(<?php echo get_template_directory_uri(); ?>/images/opacity/90/tooltip.png) no-repeat center center !important;}
  107. </style>
  108. <?php } elseif( $data['wm_enable_opacity'] == "0.8 Opacity") { ?>
  109. <style>
  110. /*<!--- .8 --->*/
  111. #menu { background: url(<?php echo get_template_directory_uri(); ?>/images/opacity/80/menu_back.png) repeat left top !important; }
  112. #hide_menu { background: url(<?php echo get_template_directory_uri(); ?>/images/opacity/80/hide_menu_back.png) no-repeat left top !important; }
  113. #main_wrap { background: url(<?php echo get_template_directory_uri(); ?>/images/opacity/80/content_back.png) repeat left top !important; }
  114. #navbar ul { opacity: 0.8 !important; }
  115. .menu_tooltip {background: url(<?php echo get_template_directory_uri(); ?>/images/opacity/80/tooltip.png) no-repeat center center !important;}
  116. </style>
  117. <?php } elseif( $data['wm_enable_opacity'] == "0.7 Opacity") { ?>
  118. <style>
  119. /*<!--- .7 --->*/
  120. #menu { background: url(<?php echo get_template_directory_uri(); ?>/images/opacity/70/menu_back.png) repeat left top !important; }
  121. #hide_menu { background: url(<?php echo get_template_directory_uri(); ?>/images/opacity/70/hide_menu_back.png) no-repeat left top !important; }
  122. #main_wrap { background: url(<?php echo get_template_directory_uri(); ?>/images/opacity/70/content_back.png) repeat left top !important; }
  123. #navbar ul { opacity: 0.7 !important; }
  124. .menu_tooltip {background: url(<?php echo get_template_directory_uri(); ?>/images/opacity/70/tooltip.png) no-repeat center center !important;}
  125. </style>
  126. <?php } elseif( $data['wm_enable_opacity'] == "Default") { ?>
  127. <style>
  128. /*<!--- Default --->*/
  129. #menu { background: url(<?php echo get_template_directory_uri(); ?>/images/menu_back.png) repeat-y top left !important; }
  130. #hide_menu { background: url(<?php echo get_template_directory_uri(); ?>/images/hide_menu_back.png) no-repeat bottom left !important; }
  131. #main_wrap { background: url(<?php echo get_template_directory_uri(); ?>/images/content_back.png) repeat-y top left !important; }
  132. </style>
  133. <?php } ?>
  134. <!-- End of New Opacity/Tranparency Options -->
  135. </head>
  136. <!-- Header ends here -->
  137. <?php
  138. ####### getting the current page template set from the page custom options #######
  139. $current_page_template = get_option('current_page_template');
  140. ####### Overlay handling #######
  141. $body_overlay = "body_home";
  142. $body_overlay_home = "";
  143. if ($data['wm_grid_hide_enabled'] == "Disable Grid Overlay on All Pages" ) {
  144. $body_overlay = "";
  145. }
  146. elseif( $data['wm_grid_hide_enabled'] == "Enable the Grid Overlay on All Pages" ){
  147. $body_overlay_home = "body_about";
  148. $body_overlay = "body_about";
  149. }
  150. else{
  151. $body_overlay = "body_about";
  152. }
  153. ######### Making conditional to hide the body content on page load #########
  154. include (TEMPLATEPATH . '/lib/show_hide_body_menu.php');
  155. #############################################################################
  156. ?>
  157. <?php if(is_home()) {?>
  158. <!--[if lte IE 7]>
  159. <style>
  160. .body_home #menu_wrap
  161. {margin: 0;}
  162. </style>
  163. <![endif]-->
  164. <?php
  165. if($data['wm_background_type'] == 'Video Background') { ?>
  166. <body <?php body_class($body_overlay_home." "."body_home video_background slider"); ?>>
  167. <?php } else { ?>
  168. <body <?php body_class($body_overlay_home." "."body_home slider"); ?>>
  169. <?php } ?>
  170. <?php } else {?>
  171. <body <?php body_class($body_overlay." ".$current_page_template);?>>
  172. <?php
  173. } ?>
  174. <?php
  175. include (TEMPLATEPATH . '/lib/background_video.php');
  176. ?>
  177. <!-- Wrapper starts here -->
  178. <div id="wrapper">
  179. <!-- Navigation starts here -->
  180. <div id="menu_wrap">
  181. <!-- Menu starts here -->
  182. <div id="menu">
  183. <!-- Logo starts here -->
  184. <div id="logo">
  185. <?php
  186. //get custom logo
  187. $theme_custom_logo = $data['wm_logo_upload'];
  188. if(!empty($theme_custom_logo))
  189. {
  190. $url = get_template_directory_uri();
  191. ?>
  192. <style type="text/css" media="all" scoped="scoped">
  193. #logo h1 a {
  194. background: url("<?php echo $theme_custom_logo ?>") no-repeat scroll center top transparent;
  195. }
  196. </style>
  197. <?php
  198. }
  199. ?>
  200. <h1><a href="<?php echo home_url(); ?>" class="logo_image index"></a></h1>
  201. </div>
  202. <!-- Logo ends here -->
  203. <!-- Navbar -->
  204. <?php
  205. wp_nav_menu( array(
  206. 'sort_column' =>'menu_order',
  207. 'container' => 'ul',
  208. 'theme_location' => 'header-nav',
  209. 'fallback_cb' => 'null',
  210. 'menu_id' => 'navbar',
  211. 'link_before' => '',
  212. 'link_after' => '',
  213. 'depth' => 0,
  214. 'walker' => new description_walker())
  215. );
  216. ?>
  217. <!-- Navbar ends here -->
  218. </div>
  219. <!-- Menu ends here -->
  220. <!-- Hide menu arrow -->
  221. <?php if ( $data['wm_menu_hide_enabled'] == "1" ) {?>
  222. <div id="hide_menu">
  223. <a href="#" class="menu_visible">Hide menu</a>
  224. <?php if ( $data['wm_menu_tooltip_enabled'] == "1" ) {?>
  225. <div class="menu_tooltip">
  226. <div class="tooltip_hide"><p><?php _e('Hide the navigation', 'kslang'); ?></p></div>
  227. <div class="tooltip_show"><p><?php _e('Show the navigation', 'kslang'); ?></p></div>
  228. </div>
  229. <?php } else { ?>
  230. <!-- No Tool Tip -->
  231. <?php } ?>
  232. </div>
  233. <?php } else { ?>
  234. <div id="hide_menu">
  235. </div>
  236. <?php } ?>
  237. <!-- Hide menu arrow ends here -->
  238. </div>
  239. <!-- Navigation ends here -->
  240. <?php
  241. global $data, $cnt_slide;
  242. if(is_home() && $data['wm_background_type'] != 'Video Background' && $cnt_slider > 0 ) {
  243. ?>
  244. <?php
  245. if($data['wm_slider_controllers']=="Enable Slider Controls"){
  246. ?>
  247. <!--Arrow Navigation-->
  248. <a id="prevslide" class="load-item">prev</a>
  249. <a id="nextslide" class="load-item">next</a>
  250. <div id="controls-wrapper" class="load-item">
  251. <div id="controls">
  252. <!-- Play button -->
  253. <a id="play-button"><img id="pauseplay" src="<?php echo get_bloginfo('template_url');?>/images/slider_pause.png"/></a>
  254. <!--Slide counter-->
  255. <div id="slidecounter">
  256. <span class="slidenumber"></span> / <span class="totalslides"></span>
  257. </div>
  258. </div>
  259. </div>
  260. <?php
  261. }
  262. ?>
  263. <!--Slide captions displayed here-->
  264. <?php
  265. if($data['wm_slider_contents'] == 'Display Title & Description' || $data['wm_slider_contents'] == 'Display Title' || $data['wm_slider_contents'] == 'Display Description'){
  266. ?>
  267. <div id="slidecaption"></div>
  268. <?php
  269. }
  270. ?>
  271. <!--END Slide captions displayed here-->
  272. <?php
  273. }
  274. ?>
  275. <?php if(is_home()) {?>
  276. </div>
  277. <?php } ?>