Advertisement
Guest User

Header.php

a guest
Oct 24th, 2012
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 9.63 KB | None | 0 0
  1. <?php
  2. include_once('functions/theme-mailer.php');
  3.  
  4. /**
  5.  * The Header for our theme.
  6.  *
  7.  * lambda framework v 2.1
  8.  * by www.unitedthemes.com
  9.  * since lambda framework v 1.0
  10.  * based on skeleton
  11.  */
  12.  
  13. global $lambda_meta_data, $theme_options, $wpdb;
  14.  
  15. if(!$lambda_meta_data->get_the_value(UT_THEME_INITIAL.'column_layout')) { $columnset = 1; } else { $columnset = $lambda_meta_data->get_the_value(UT_THEME_INITIAL.'column_layout'); }
  16.  
  17. ?>
  18. <!doctype html>
  19. <html <?php language_attributes(); ?>>
  20. <!--
  21. ========================================================================
  22.  Nevada WordPress Theme by United Themes (http://www.unitedthemes.com)
  23.  Marcel Moerkens & Matthew Nettekoven
  24. ========================================================================
  25. -->
  26. <meta charset="<?php bloginfo( 'charset' ); ?>" />
  27.  
  28. <title><?php
  29.     // Detect Yoast SEO Plugin
  30.     if (defined('WPSEO_VERSION')) {
  31.         wp_title('');
  32.     } else {
  33.     /*
  34.      * Print the <title> tag based on what is being viewed.
  35.      */
  36.     global $page, $paged;
  37.  
  38.     wp_title( '|', true, 'right' );
  39.  
  40.     // Add the blog name.
  41.     bloginfo( 'name' );
  42.  
  43.     // Add the blog description for the home/front page.
  44.     $site_description = get_bloginfo( 'description', 'display' );
  45.     if ( $site_description && ( is_home() || is_front_page() ) )
  46.         echo " | $site_description";
  47.  
  48.     // Add a page number if necessary:
  49.     if ( $paged >= 2 || $page >= 2 )
  50.         echo ' | ' . sprintf( __( 'Page %s', UT_THEME_NAME ), max( $paged, $page ) );
  51.     }
  52.     ?>
  53. </title>
  54.  
  55.  
  56. <!--[if lte IE 8]>
  57.   <link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/css/ie8.css" media="screen" />
  58. <![endif]-->
  59.  
  60. <!--[if IE]>
  61.     <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
  62.     <script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js"></script>
  63. <![endif]-->
  64.  
  65.  
  66. <!-- Mobile Specific Metas
  67. ================================================== -->
  68.  
  69. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
  70.  
  71. <!-- Favicons
  72. ================================================== -->
  73.  
  74. <link rel="shortcut icon" href="<?php echo get_option_tree('favicon'); ?>">
  75.  
  76. <link rel="apple-touch-icon" href="<?php echo get_option_tree('apple_touch_icon_small'); ?>">
  77. <link rel="apple-touch-icon" sizes="72x72" href="<?php echo get_option_tree('apple_touch_icon_mid'); ?>" />
  78. <link rel="apple-touch-icon" sizes="114x114" href="<?php echo get_option_tree('apple_touch_icon'); ?>" />
  79.  
  80. <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
  81.  
  82. <?php
  83.    
  84.     // enqueue threaded comments support.
  85.     if ( is_singular() && get_option( 'thread_comments' ) )
  86.     wp_enqueue_script( 'comment-reply' );
  87.    
  88.     // Load head elements
  89.     wp_head();
  90.  
  91.     #-----------------------------------------------------------------
  92.     # Sidebar Alignement
  93.     #-----------------------------------------------------------------
  94.     if(is_home()) {
  95.            
  96.         $homeid = get_option('page_for_posts');  
  97.         $meta_sidebar = get_post_meta($homeid, $lambda_meta_data->get_the_id(), TRUE);
  98.                    
  99.     } else {
  100.        
  101.         $meta_sidebar = $lambda_meta_data->the_meta();
  102.        
  103.     }
  104.     $meta_sidebar = (isset($meta_sidebar['sidebar_align'])) ? $meta_sidebar['sidebar_align'] : '';
  105.    
  106.     $sidebar_position = (!empty($meta_sidebar)) ? $meta_sidebar : $theme_options['sidebar_alignement'];
  107.     $content_position = ($sidebar_position == "right" ? "left" : "right");
  108.     $sidebar_margin = ($sidebar_position == "right" ? "left" : "right");
  109.     $sidebar_second_margin = ($sidebar_position == "both" ? "left" : "right");
  110.    
  111.     ?>
  112.    
  113.    
  114.     <?php
  115.     #-----------------------------------------------------------------
  116.     # Dynamic CSS
  117.     #-----------------------------------------------------------------
  118.     ?> 
  119.     <style type="text/css">
  120.    
  121.     <?php customBackground();           // located in theme-layout-functions.php ?>
  122.     <?php customSliderBackground();     // located in theme-layout-functions.php ?>
  123.     <?php customWrap();                 // located in theme-layout-functions.php ?>
  124.     <?php customFooter();                // located in theme-layout-functions.php ?>
  125.        
  126.     <?php echo ($theme_options['custom_css']); ?>
  127.    
  128.     #wrap #content {float:<?php echo $content_position; ?>;}
  129.     #wrap #sidebar {float:<?php echo $sidebar_position; ?>;}
  130.     #wrap #sidebar .widget-container {margin-<?php echo $sidebar_margin; ?>: 20px;margin-<?php echo $sidebar_position; ?>: 0px;}
  131.    
  132.     /* second sidebar enhancement */   
  133.     #wrap #sidebar_second {float:<?php echo $content_position; ?>;}
  134.     #wrap #sidebar_second .widget-container {margin-<?php echo $sidebar_second_margin; ?>: 20px;margin-<?php echo $content_position; ?>: 0px;}
  135.    
  136.     </style>
  137.  
  138. </head>
  139.  
  140.  
  141.  
  142.  
  143.  
  144. <body <?php body_class(); ?>>
  145.  
  146. <!-- to top button -->
  147. <div id="toTop">Go to Top</div>
  148. <!-- end to top button -->
  149.    
  150.     <?php
  151.     #-----------------------------------------------------------------
  152.     # Supersized
  153.     #-----------------------------------------------------------------
  154.     if(is_home()) {
  155.            
  156.         $homeid = get_option('page_for_posts');  
  157.         $slides = get_post_meta($homeid, $lambda_meta_data->get_the_id(), TRUE);
  158.                    
  159.     } else {
  160.        
  161.         $slides = $lambda_meta_data->the_meta();
  162.        
  163.     }
  164.            
  165.     //can be overwritten by metapanel
  166.     $default_bgslider = $theme_options['default_backgroundslider'];
  167.     $sitelayout = get_option_tree('sitelayout');
  168.     $backgroundtype = $theme_options['background_type'];
  169.  
  170.    
  171.     //meta panel settings to overwrite default option tree settings
  172.     $sitelayout = (isset($slides['sitelayout'])) ? $slides['sitelayout'] : $sitelayout;
  173.     $backgroundtype = (isset($slides['background_type'])) ? $slides['background_type'] : $backgroundtype;
  174.     $default_bgslider = (isset($slides['default_backgroundslider'])) ? $slides['default_backgroundslider'] : $default_bgslider;
  175.    
  176.     if( isset($default_bgslider) ) {   
  177.    
  178.         if( isset($default_bgslider) && ($backgroundtype == 'default_backgroundslider' ) && ($sitelayout == 'boxed') ) {
  179.                                                
  180.             $sliderinfo = explode('_', $default_bgslider);
  181.             $slides['main_slider'] = $default_bgslider;
  182.            
  183.             $table_lambda_sliders = $wpdb->prefix . "lambda_sliders";
  184.             $supersized = $wpdb->get_var("SELECT slidertype FROM $table_lambda_sliders WHERE id = $sliderinfo[1]");
  185.        
  186.         }  
  187.            
  188.         if(isset($supersized) && $supersized == 'supersized')  
  189.         lambda_main_slider($slides); // this function can be found in theme-functions.php around line 198
  190.            
  191.     } ?>
  192.    
  193.    
  194.     <div id="wrap" class="container clearfix" data-role="page">
  195.        
  196.     <?php
  197.     #-----------------------------------------------------------------
  198.     # Plugin Notification
  199.     #-----------------------------------------------------------------
  200.     if(lambda_is_plugin_active('option-tree/index.php')) {
  201.          echo '<div class="alert red">'.__('Option Tree Plugin has been detected! Please deactivate this Plugin to prevent themecrashes and failures!', UT_THEME_NAME ).'</div>';
  202.     }
  203.     if(lambda_is_plugin_active('soundcloud-shortcode/soundcloud-shortcode.php')) {
  204.          echo '<div class="alert red">'.__('Soundcloud Plugin has been detected! Please deactivate this Plugin to prevent themecrashes and failures!', UT_THEME_NAME ).'</div>';
  205.     }
  206.        
  207.     ?>
  208.    
  209.     <header id="header" class="fluid clearfix" data-role="header">
  210.     <div class="container">    
  211.                
  212.         <?php
  213.         // Build the logo or text
  214.         if (get_option_tree('textorlogo') == 'Logo') {
  215.            
  216.             $lambda_logo  = '<div id="logo">
  217.                                 <a href="'.esc_url( home_url( '/' ) ).'" title="'.esc_attr( get_bloginfo('name','display')).'"><img id="sitelogo" src="'.get_option_tree('header_logo').'"></a>
  218.                             </div>';   
  219.             } else {
  220.             $lambda_logo  = '<div id="logo"><h1>
  221.                                 <a href="'.esc_url( home_url( '/' ) ).'" title="'.esc_attr( get_bloginfo('name','display')).'">'.get_bloginfo('name').'</a>
  222.                             </h1></div>';
  223.             }
  224.         echo apply_filters ( 'child_logo' , $lambda_logo);
  225.         ?>
  226.        
  227.        
  228.             <div class="h-right">
  229.                    
  230.                     <!-- Tagline -->       
  231.                     <?php if(isset($theme_options['top_header_tagline'])) : ?>
  232.                                      
  233.                     <span class="top-header-tagline">  
  234.                         <?php echo stripslashes($theme_options['top_header_tagline']); ?>                      
  235.                     </span><!-- Top Header Tagline -->                 
  236.                    
  237.                     <?php endif; ?>
  238.                    
  239.                    
  240.                    
  241.                     <!-- Social Icons -->                  
  242.                    
  243.                     <?php if (is_active_sidebar('header-widget-area')) :
  244.                             dynamic_sidebar('header-widget-area');
  245.                     endif;?>
  246.                    
  247.                     <!-- /Social Icons -->
  248.                    
  249.            
  250.         </div>
  251.       </div>  
  252.      
  253.     </header><!--/#header-->
  254.        
  255.         <div class="clear"></div>
  256.        
  257.         <div class="nav-wrap">
  258.             <div class="container">
  259.             <?php
  260.             //Navigation
  261.                
  262.             //main navigation
  263.             wp_nav_menu( array( 'container'         => 'nav',  
  264.                                 'container_id'      => 'navigation',
  265.                                 'theme_location'    => 'primary-menu',
  266.                                 'fallback_cb'       => 'default_menu',
  267.                                 'menu_class'        => 'menu clearfix',
  268.                                 'container_class'   => 'clearfix',
  269.                                 'walker'            => new lambda_walker())
  270.             );
  271.             ?> 
  272.            
  273.             <?php if ( has_nav_menu( 'mobile-menu' ) ) {
  274.            
  275.                 echo '<div class="mm-trigger">'.get_bloginfo('name').'<button class="mm-button"></button></div>';
  276.                
  277.                 wp_nav_menu( array( 'theme_location' => 'mobile-menu',
  278.                                     'container_id' => 'mobile-menu',
  279.                                     'container' => 'nav',
  280.                                     'menu_class' => 'mm-menu',
  281.                                     'depth' => 1 ) );
  282.                                            
  283.             } ?>
  284.            
  285.            
  286.             </div>
  287.            
  288.         </div>
  289.    
  290.     <div class="clear"></div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement