1. <?php
  2. /**
  3. * Header Template
  4. *
  5. * Here we setup all logic and XHTML that is required for the header section of all screens.
  6. *
  7. * @package WooFramework
  8. * @subpackage Template
  9. */
  10.  
  11. global $woo_options;
  12.  
  13. ?><!DOCTYPE html>
  14. <html <?php language_attributes(); ?>>
  15. <head>
  16.  
  17. <meta charset="<?php bloginfo( 'charset' ); ?>" />
  18.  
  19. <title><?php woo_title(''); ?></title>
  20. <?php woo_meta(); ?>
  21. <?php if ( isset($woo_options['woo_alt_stylesheet']) && ( $woo_options['woo_alt_stylesheet'] == 'default.css' || $woo_options['woo_alt_stylesheet'] == '' ) ) { ?><link rel="stylesheet" type="text/css" href="<?php bloginfo( 'stylesheet_url' ); ?>" media="screen" /><?php } ?>
  22. <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
  23. <?php
  24. wp_head();
  25. woo_head();
  26. ?>
  27. <?php
  28. if ( isset( $woo_options['woo_content_width'] ) ) {
  29. $content_width = $woo_options['woo_content_width'];
  30. ?>
  31. <link rel="stylesheet" type="text/css" href="<?php echo get_stylesheet_directory_uri(); ?>/css/generator.php?content_width=<?php echo $content_width; ?>" media="screen" />
  32. <?php } ?>
  33. </head>
  34.  
  35. <body <?php body_class(); ?>>
  36.  
  37. <?php woo_top(); ?>
  38.  
  39. <?php
  40. $floated_header = false;
  41. $floated_fixed_header = false;
  42. if ( isset( $woo_options['woo_floated_header'] ) && $woo_options['woo_floated_header'] == 'true' ) {
  43. $floated_header = true;
  44. if ( isset( $woo_options['woo_floated_fixed_header'] ) && $woo_options['woo_floated_fixed_header'] == 'true' ) {
  45. $floated_fixed_header = true;
  46. }
  47. }
  48.  
  49. ?>
  50.  
  51. <div id="wrapper" <?php if( $floated_header && $floated_fixed_header ) { echo 'class="floated-header fixed"'; } elseif ( $floated_header ) { echo 'class="floated-header"'; } ?>>
  52.  
  53. <?php if ( function_exists( 'has_nav_menu' ) && has_nav_menu( 'top-menu' ) ) { ?>
  54.  
  55. <div id="top">
  56. <nav class="col-full" role="navigation">
  57. <?php wp_nav_menu( array( 'depth' => 6, 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_id' => 'top-nav', 'menu_class' => 'nav fl', 'theme_location' => 'top-menu' ) ); ?>
  58. </nav>
  59. </div><!-- /#top -->
  60.  
  61. <?php } ?>
  62.  
  63. <header id="header" class="col-full">
  64.  
  65. <?php
  66. $logo = get_template_directory_uri() . '/images/logo.png';
  67. if ( isset( $woo_options['woo_logo'] ) && $woo_options['woo_logo'] != '' ) { $logo = $woo_options['woo_logo']; }
  68. ?>
  69. <?php if ( ! isset( $woo_options['woo_texttitle'] ) || $woo_options['woo_texttitle'] != 'true' ) { ?>
  70. <a id="logo" href="<?php bloginfo( 'url' ); ?>" title="<?php bloginfo( 'description' ); ?>">
  71. <img src="<?php echo $logo; ?>" alt="<?php bloginfo( 'name' ); ?>" />
  72. </a>
  73. <?php } ?>
  74.  
  75. <hgroup>
  76.  
  77. <h1 class="site-title"><a href="<?php bloginfo( 'url' ); ?>"><?php bloginfo( 'name' ); ?></a></h1>
  78. <h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>
  79. <h3 class="nav-toggle"><a href="#navigation"><?php _e('Navigation', 'woothemes'); ?></a></h3>
  80.  
  81. </hgroup>
  82.  
  83. <nav id="navigation" role="navigation">
  84.  
  85. <?php
  86. if ( function_exists( 'has_nav_menu' ) && has_nav_menu( 'primary-menu' ) ) {
  87. wp_nav_menu( array( 'depth' => 6, 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_id' => 'main-nav', 'menu_class' => 'nav', 'theme_location' => 'primary-menu' ) );
  88. } else {
  89. ?>
  90. <ul id="main-nav" class="nav">
  91. <?php if ( is_page() ) $highlight = 'page_item'; else $highlight = 'page_item current_page_item'; ?>
  92. <li class="<?php echo $highlight; ?>"><a href="<?php echo home_url( '/' ); ?>"><?php _e( 'Home', 'woothemes' ); ?></a></li>
  93. <?php wp_list_pages( 'sort_column=menu_order&depth=6&title_li=&exclude=' ); ?>
  94. </ul><!-- /#nav -->
  95. <?php } ?>
  96.  
  97. </nav><!-- /#navigation -->
  98.  
  99. <?php woo_nav_after(); ?>
  100.  
  101. <?php if ( isset( $woo_options['woo_header_search'] ) && $woo_options['woo_header_search'] == 'true' ) { ?>
  102. <div class="search_main fix">
  103. <form method="get" class="searchform" action="<?php echo home_url( '/' ); ?>" >
  104. <input type="text" class="field s" name="s" value="<?php esc_attr_e( 'Search…', 'woothemes' ); ?>" onfocus="if ( this.value == '<?php esc_attr_e( 'Search…', 'woothemes' ); ?>' ) { this.value = ''; }" onblur="if ( this.value == '' ) { this.value = '<?php esc_attr_e( 'Search…', 'woothemes' ); ?>'; }" />
  105. <input type="image" src="<?php echo get_template_directory_uri(); ?>/images/ico-search.png" class="search-submit" name="submit" alt="Submit" />
  106. <?php if ( is_woocommerce_activated() ) { ?>
  107. <input type="hidden" name="post_type" value="<?php echo $woo_options['woo_header_search_scope']; ?>" />
  108. <?php } ?>
  109. </form>
  110. </div><!--/.search_main-->
  111. <?php } elseif ( isset( $woo_options['woo_ad_top'] ) && $woo_options['woo_ad_top'] == 'true' ) { ?>
  112. <div id="topad">
  113. <?php
  114. if ( isset( $woo_options['woo_ad_top_adsense'] ) && $woo_options['woo_ad_top_adsense'] != '' ) {
  115. echo stripslashes( $woo_options['woo_ad_top_adsense'] );
  116. } else {
  117. if ( isset( $woo_options['woo_ad_top_url'] ) && isset( $woo_options['woo_ad_top_image'] ) )
  118. ?>
  119. <a href="<?php echo $woo_options['woo_ad_top_url']; ?>"><img src="<?php echo $woo_options['woo_ad_top_image']; ?>" width="468" height="60" alt="advert" /></a>
  120. <?php } ?>
  121. </div><!-- /#topad -->
  122. <?php } ?>
  123. </header><!-- /#header -->