Advertisement
Guest User

ELIplay header php for Sarah.n

a guest
Mar 18th, 2013
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.75 KB | None | 0 0
  1. <?php
  2. /**
  3. * The Header for our theme.
  4. *
  5. * Displays all of the <head> section and everything up till <div id="main">
  6. *
  7. * @since alterna 1.0
  8. */
  9. ?>
  10. <!DOCTYPE html>
  11. <!--[if IE 6]>
  12. <html id="ie6" <?php language_attributes(); ?>>
  13. <![endif]-->
  14. <!--[if IE 7]>
  15. <html id="ie7" <?php language_attributes(); ?>>
  16. <![endif]-->
  17. <!--[if IE 8]>
  18. <html id="ie8" <?php language_attributes(); ?>>
  19. <![endif]-->
  20. <!--[if !(IE 6) | !(IE 7) | !(IE 8) ]><!-->
  21. <html <?php language_attributes(); ?>>
  22. <!--<![endif]-->
  23. <meta charset="<?php bloginfo( 'charset' ); ?>" />
  24.  
  25. <?php
  26. global $page, $paged, $post;
  27.  
  28. // get the current page
  29. $paged = 1;
  30. if (get_query_var('paged')) {
  31. $paged = get_query_var('paged');
  32. } else if (get_query_var('page')) {
  33. $paged = get_query_var('page');
  34. }
  35.  
  36. /* Custom SEO */
  37. if( alterna_get_options_key('seo-enable') == "yes" && (is_home() || is_page() || is_single() || (taxonomy_exists('portfolio_categories') && is_tax())) ) {
  38.  
  39. $meta_title ="";
  40. $meta_description="";
  41. $meta_keywords="";
  42.  
  43. $page_id = get_the_ID();
  44.  
  45. if(is_home() && is_front_page()){
  46. $meta_title = alterna_get_options_key('seo-title');
  47. $meta_description = alterna_get_options_key('seo-description');
  48. $meta_keywords = alterna_get_options_key('seo-keywords');
  49. }else{
  50. if((is_home() && !is_front_page())) $page_id = get_option('page_for_posts');
  51. if((!is_home() && is_front_page())) $page_id = get_option('page_on_front');
  52. $meta_title = get_post_meta($page_id , 'seo-title', true);
  53. $meta_description = get_post_meta($page_id , 'seo-description', true);
  54. $meta_keywords = get_post_meta($page_id , 'seo-keywords', true);
  55. }
  56.  
  57. ?><title><?php
  58.  
  59. if($meta_title == "") {
  60. wp_title( '|', true, 'right' );
  61. } else {
  62. echo $meta_title.' | ';
  63. }
  64.  
  65. // Add the blog name.
  66. bloginfo( 'name' );
  67.  
  68. // Add the blog description for the home/front page.
  69. $site_description = get_bloginfo( 'description', 'display' );
  70. if ( $site_description && ( is_home() || is_front_page() ) )
  71. echo " | $site_description";
  72.  
  73. // Add a page number if necessary:
  74. if ( $paged >= 2 || $page >= 2 )
  75. echo ' | ' . sprintf( __( 'Page %s', 'alterna' ), max( $paged, $page ) );
  76.  
  77. ?></title><?php
  78.  
  79. //Description
  80. echo '<meta name="description" content="'.$meta_description.'" />';
  81.  
  82. //Keywords
  83. echo '<meta name="keywords" content="'.$meta_keywords.'" />';
  84.  
  85. } else {
  86. ?><title><?php
  87.  
  88. wp_title( '|', true, 'right' );
  89.  
  90. // Add the blog name.
  91. bloginfo( 'name' );
  92.  
  93. // Add the blog description for the home/front page.
  94. $site_description = get_bloginfo( 'description', 'display' );
  95. if ( $site_description && ( is_home() || is_front_page() ) )
  96. echo " | $site_description";
  97.  
  98. // Add a page number if necessary:
  99. if ( $paged >= 2 || $page >= 2 )
  100. echo ' | ' . sprintf( __( 'Page %s', 'alterna' ), max( $paged, $page ) );
  101.  
  102. ?></title><?php } ?>
  103.  
  104. <?php if(intval(alterna_get_options_key('global-responsive')) == 0 ) : ?>
  105. <!-- Mobile viewport optimized: j.mp/bplateviewport -->
  106. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  107. <?php endif; ?>
  108.  
  109. <link rel="shortcut icon" href="<?php echo (alterna_get_options_key('favicon') != "") ? alterna_get_options_key('favicon') : get_template_directory_uri()."/img/favicon.png";?>" />
  110.  
  111. <link rel="profile" href="http://gmpg.org/xfn/11" />
  112.  
  113. <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
  114.  
  115. <!--[if IE 7]>
  116. <link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/fontawesome/css/font-awesome-ie7.min.css">
  117. <![endif]-->
  118.  
  119. <!--[if lt IE 9]>
  120. <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
  121. <![endif]-->
  122.  
  123. <?php
  124. /* We add some JavaScript to pages with the comment form
  125. * to support sites with threaded comments (when in use).
  126. */
  127. if ( is_singular() && get_option( 'thread_comments' ) )
  128. wp_enqueue_script( 'comment-reply' );
  129.  
  130. /* Always have wp_head() just before the closing </head>
  131. * tag of your theme, or you will break many plugins, which
  132. * generally use this hook to add elements to <head> such
  133. * as styles, scripts, and meta tags.
  134. */
  135. wp_head();
  136. ?>
  137. </head>
  138.  
  139. <body <?php body_class( array((intval(alterna_get_options_key('global-layout')) == 0 ? 'boxed-layout' : 'full-width-layout') , (intval(alterna_get_options_key('global-responsive')) == 0 ? '' : 'fixed-width'))); ?>>
  140. <div class="header-wrap <?php echo intval(alterna_get_options_key('global-layout')) == 0 ? 'container' : '';?>">
  141. <!-- header alert message -->
  142. <div class="header-top-content" >
  143. <div class="container">
  144. <div class="header-information">
  145. <?php echo do_shortcode(alterna_get_options_key('header-alert-message')); ?>
  146. <?php
  147. if (class_exists( 'woocommerce' )) {
  148. get_template_part('woocommerce/content-header');
  149. }else if( alterna_get_options_key('custom-enable-login') == "yes" && alterna_get_options_key('custom-login-page') != ""){ ?>
  150. <div class="custom-login-header">
  151. <div class="custom-login">
  152. <?php if ( is_user_logged_in() ) { ?>
  153. <a href="<?php echo alterna_get_options_key('custom-login-page'); ?>" title="<?php _e( 'View your account', 'alterna' ); ?>"><?php
  154. global $current_user;
  155. get_currentuserinfo();
  156. if($current_user->user_firstname)
  157. echo __('Welcome, ','alterna') . $current_user->user_firstname;
  158. elseif($current_user->display_name)
  159. echo __('Welcome, ','alterna') . $current_user->display_name;
  160. ?></a>&nbsp;&nbsp;<?php _e('|','alterna'); ?>&nbsp;&nbsp;<a href="<?php echo wp_logout_url(get_permalink()); ?>"><?php _e('Log out','alterna'); ?></a>
  161. <?php } else { ?>
  162. <a class="wc-login-in" href="<?php echo alterna_get_options_key('custom-login-page'); ?>" title="<?php _e( 'Login / Register', 'alterna' ); ?>"><?php _e( 'Login / Register', 'alterna' ); ?></a>
  163. <?php } ?>
  164. </div>
  165. </div>
  166. <?php }
  167. ?>
  168. </div>
  169. </div>
  170. </div>
  171.  
  172. <header class="container">
  173. <!-- logo & social -->
  174. <div id="alterna-header" class="row-fluid">
  175. <div class="logo">
  176. <a href="<?php echo home_url(); ?>" title="<?php bloginfo('name'); ?>"><?php if(alterna_get_options_key('logo-txt-enable') == "yes") echo '<h2>'.get_bloginfo( 'name' ).'</h2>'; ?></a>
  177. </div>
  178. <?php if(intval(alterna_get_options_key('header-right-area-type')) == 0) : ?>
  179. <div class="header-social-container">
  180. <ul class="inline alterna-social header-social">
  181. <?php
  182. echo alterna_get_social_list();
  183. if(alterna_get_options_key('rss-feed') != "") echo '<li><a title="'.__('rss','alterna').'" href="'.alterna_get_options_key('rss-feed').'" class="alterna-icon-rss"></a></li>';
  184. ?>
  185. </ul>
  186. </div>
  187. <?php else : ?>
  188. <div class="header-custom-container">
  189. <?php echo do_shortcode(alterna_get_options_key('header-right-area-content')); ?>
  190. </div>
  191. <?php endif; ?>
  192. </div>
  193.  
  194. <!-- mobile show drop select menu -->
  195. <div id="alterna-drop-nav" class="row-fluid navbar">
  196. <div id="alterna-nav-menu-select" class="navbar-inverse">
  197. <button type="button" class="btn btn-navbar collapsed" data-toggle="collapse" data-target=".nav-collapse">
  198. <span class="icon-bar"></span>
  199. <span class="icon-bar"></span>
  200. <span class="icon-bar"></span>
  201. </button>
  202. <div class="nav-collapse collapse"><ul class="nav"></ul></div>
  203. </div>
  204. </div>
  205.  
  206. <!-- menu & search form -->
  207. <nav id="alterna-nav" class="row-fluid">
  208. <div class="container">
  209. <?php if(alterna_get_options_key('fixed-enable') == "yes") : ?>
  210. <div class="fixed-logo">
  211. <a href="<?php echo home_url(); ?>" title="<?php bloginfo('name'); ?>"></a>
  212. </div>
  213. <?php endif; ?>
  214. <?php
  215. $alterna_main_menu = array(
  216. 'theme_location' => 'alterna_menu',
  217. 'container_class' => 'alterna-nav-menu-container',
  218. 'menu_class' => 'alterna-nav-menu',
  219. 'fallback_cb' => 'alterna_show_setting_primary_menu'
  220. );
  221. wp_nav_menu($alterna_main_menu);
  222. ?>
  223. <div class="alterna-nav-form-container">
  224. <div class="alterna-nav-form">
  225. <form role="search" class="searchform" method="get" action="<?php echo esc_url( home_url( '/' ) ); ?>">
  226. <div>
  227. <input id="sf-s" name="s" type="text" placeholder="<?php _e('Search','alterna'); ?>" />
  228. <input id="sf-searchsubmit" type="submit" value="" />
  229. </div>
  230. </form>
  231. </div>
  232. </div>
  233. </div>
  234. </nav>
  235. </header>
  236.  
  237. </div><!-- end header-wrap -->
  238.  
  239. <div class="content-wrap <?php echo intval(alterna_get_options_key('global-layout')) == 0 ? 'container' : '';?>">
  240.  
  241. <?php
  242. // current post, page id
  243. $post_id = ($post) ? $post->ID : '-1';
  244. if(is_home() && !is_front_page()) $post_id = get_option('page_for_posts');
  245. // show header layerslider
  246. if(!(is_category()|| is_tag() || is_404() || is_search() || is_date()) && intval(get_post_meta($post_id , 'slide-type', true)) != 0) :
  247. ?>
  248. <?php if(intval(get_post_meta($post_id , 'slide-type', true)) == 1 && intval(get_post_meta($post_id , 'layer-slide-id', true)) != 0) : ?>
  249. <div id="layerslide-container" class="container">
  250. <?php echo do_shortcode('[layerslider id="'.(intval(get_post_meta($post_id , 'layer-slide-id', true))).'"]'); ?>
  251. </div>
  252. <?php elseif(intval(get_post_meta($post_id , 'slide-type', true)) == 2 && intval(get_post_meta($post_id , 'rev-slide-id', true)) != 0) : ?>
  253. <div id="revslide-container" class="container">
  254. <?php echo do_shortcode('[rev_slider '.(intval(get_post_meta($post_id , 'rev-slide-id', true))).']'); ?>
  255. </div>
  256. <?php endif; ?>
  257. <?php endif; ?>
  258.  
  259.  
  260. <?php // show header title
  261.  
  262. $current_tax = get_query_var('taxonomy');
  263.  
  264. if((is_tax() && taxonomy_exists('product_cat') && $current_tax == "product_cat") || is_singular('product')) {
  265. echo '';
  266. } elseif (((is_home()|| is_page() || is_single()) && intval(get_post_meta($post_id , 'title-show', true)) == 0) && !is_front_page()) { ?>
  267. <div id="page-header" class="container">
  268. <div class="page-header-content row-fluid">
  269. <div class="title span12">
  270. <?php
  271. $title = get_post_meta($post_id, 'title-content', true);
  272. if($title == '') $title = '<h2>'.get_the_title($post_id).'</h2>';
  273. echo $title;
  274. ?>
  275. </div>
  276. </div>
  277. <div class="line"></div>
  278. <div class="desc row-fluid">
  279. <ul><?php echo alterna_page_links(); ?></ul>
  280. </div>
  281. </div>
  282. <?php } elseif ( ((is_tax() && taxonomy_exists('portfolio_categories') && $current_tax == "portfolio_categories") || is_category()|| is_tag() || is_404() || is_search() || is_date()) && !is_front_page()) {?>
  283. <div id="page-header" class="container">
  284. <div class="page-header-content row-fluid">
  285. <div class="title span12">
  286. <h2><?php echo alterna_page_title();?></h2>
  287. </div>
  288. </div>
  289. <div class="line"></div>
  290. <div class="desc row-fluid">
  291. <ul>
  292. <?php echo alterna_page_links(); ?>
  293. <?php if(is_search()) : ?>
  294. <li><i class="icon-chevron-right"></i><span><?php printf( __( 'Search Results for "%s"', 'alterna' ), get_search_query() ); ?></span></li>
  295. <?php endif; ?>
  296. </ul>
  297. </div>
  298. </div>
  299. <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement