Lots of minor styling upgrades
[dss-plugins:ryanhellyers-dss-framework.git] / header.php
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  * @package WordPress
8  * @subpackage DSS_Framework
9  * @since DSS Framework 1.0
10  */
11 ?><!DOCTYPE html>
12 <!--[if IE 6]>
13 <html id="ie6" <?php language_attributes(); ?>>
14 <![endif]-->
15 <!--[if IE 7]>
16 <html id="ie7" <?php language_attributes(); ?>>
17 <![endif]-->
18 <!--[if IE 8]>
19 <html id="ie8" <?php language_attributes(); ?>>
20 <![endif]-->
21 <!--[if !(IE 6) | !(IE 7) | !(IE 8)  ]><!-->
22 <html <?php language_attributes(); ?>>
23 <!--<![endif]-->
24 <head>
25 <meta charset="<?php bloginfo( 'charset' ); ?>" />
26 <meta name="viewport" content="width=device-width" />
27 <title><?php wp_title( '|', true, 'right' ); ?></title>
28 <link rel="profile" href="http://gmpg.org/xfn/11" />
29 <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
30 <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
31 <!--[if lt IE 9]>
32 <script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script>
33 <![endif]-->
34 <?php wp_head(); ?>
35 </head>
36
37 <body <?php body_class(); ?>>
38 <div id="page" class="hfeed">
39         <header id="branding" role="banner">
40                 <hgroup>
41                         <img id="logo" src="<?php echo get_template_directory_uri(); ?>/images/logo-blue.png" alt="Regjeringen logo" />
42                         <div id="header-content">
43                                 <a id="govt-link" href="http://regjeringen.no/">regjeringen.no</a><?php
44
45                                 // The search form
46                                 get_search_form();
47
48                                 // Display site title
49                                 if ( '' != dss_get_theme_option( 'theme_heading' ) ) {
50                                         echo '<h1 id="site-title">';
51
52                                         // Open link if URL specified
53                                         if ( '' != dss_get_theme_option( 'theme_heading_link' ) )
54                                                 echo '<a href="' . esc_url( dss_get_theme_option( 'theme_heading_link' ) ) . '">';
55
56                                         // Theme name
57                                         echo dss_get_theme_option( 'theme_heading' );
58
59                                         // Close link if URL specified
60                                         if ( '' != dss_get_theme_option( 'theme_heading_link' ) )
61                                                 echo '</a>';
62
63                                         echo '</h1>';
64                                 }
65         
66                                 // Display site description
67                                 if ( get_bloginfo( 'description' ) ) {
68                                 ?>
69                                 <h2 id="site-description"><?php echo get_bloginfo( 'description' ); ?></h2><?php
70                                 } ?>
71                         </div>
72                 </hgroup>
73                 <?php
74                         // Check to see if the header image has been removed
75                         $header_image = get_header_image();
76                         if ( $header_image ) :
77                                 // We need to figure out what the minimum width should be for our featured image.
78                                 // This result would be the suggested width if the theme were to implement flexible widths.
79                                 $header_image_width = get_theme_support( 'custom-header', 'width' );
80
81                 ?>
82                 <a id="header-image" href="<?php echo esc_url( home_url( '/' ) ); ?>">
83                         <?php
84                                 // The header image
85                                 // Check if this is a post or page, if it has a thumbnail, and if it's a big one
86                                 if ( is_singular() && has_post_thumbnail( $post->ID ) &&
87                                                 ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) ) ) &&
88                                                 $image[1] >= $header_image_width ) :
89                                         // Houston, we have a new header image!
90                                         echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
91                                 else :
92                                         $header_image_width  = get_custom_header()->width;
93                                         $header_image_height = get_custom_header()->height;
94                                         ?>
95                                 <img src="<?php header_image(); ?>" width="<?php echo $header_image_width; ?>" height="<?php echo $header_image_height; ?>" alt="" />
96                         <?php endif; // end check for featured image or standard header ?>
97                 </a>
98                 <?php endif; // end check for removed header image
99
100                 // Display the site heading
101                 if ( '' != get_bloginfo( 'name', 'display' ) ) {
102                         echo '<div id="site-heading-wrapper"><h2 id="site-heading"><a href="' . home_url( '/' ) . '">' . get_bloginfo( 'name' ) . '</a></h2></div>';
103                 }
104                 ?>
105
106                 <nav id="access" role="navigation">
107                         <h3 class="assistive-text"><?php _e( 'Main menu', 'dss' ); ?></h3>
108                         <?php /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff. */ ?>
109                         <div class="skip-link"><a class="assistive-text" href="#content" title="<?php esc_attr_e( 'Skip to primary content', 'dss' ); ?>"><?php _e( 'Skip to primary content', 'dss' ); ?></a></div>
110                         <div class="skip-link"><a class="assistive-text" href="#secondary" title="<?php esc_attr_e( 'Skip to secondary content', 'dss' ); ?>"><?php _e( 'Skip to secondary content', 'dss' ); ?></a></div>
111                         <?php /* Our navigation menu. If one isn't filled out, wp_nav_menu falls back to wp_page_menu. The menu assigned to the primary location is the one used. If one isn't assigned, the menu with the lowest ID is used. */ ?>
112                         <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>
113                 </nav><!-- #access -->
114         </header><!-- #branding -->
115
116
117         <div id="main">