Advertisement
Guest User

header.php

a guest
Jun 4th, 2012
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.36 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4.  
  5. * The Header for our theme.
  6.  
  7. *
  8.  
  9. * Displays all of the <head> section and everything up till <div id="main">
  10.  
  11. *
  12.  
  13. * @package WordPress
  14.  
  15. * @subpackage Twenty_Ten
  16.  
  17. * @since Twenty Ten 1.0
  18.  
  19. */
  20.  
  21. ?><!DOCTYPE html>
  22.  
  23. <html <?php language_attributes(); ?> itemscope itemtype="http://schema.org/Organization">
  24.  
  25. <head>
  26.  
  27. <meta charset="<?php bloginfo( 'charset' ); ?>" />
  28.  
  29. <title><?php
  30.  
  31. /*
  32.  
  33. * Print the <title> tag based on what is being viewed.
  34.  
  35. */
  36.  
  37. global $page, $paged;
  38.  
  39.  
  40.  
  41. // Add the word tag to tag pages.
  42.  
  43. $site_description = 'Tag - ';
  44.  
  45. if ( $site_description && ( is_tag() ) )
  46.  
  47. echo " $site_description";
  48.  
  49. wp_title( '|', true, 'right' );
  50.  
  51.  
  52.  
  53. // Add the blog name.
  54.  
  55. bloginfo( 'name' );
  56.  
  57.  
  58.  
  59. // Add the blog description for the home/front page.
  60.  
  61. $site_description = get_bloginfo( 'description', 'display' );
  62.  
  63. if ( $site_description && ( is_home() || is_front_page() ) )
  64.  
  65. echo " | $site_description";
  66.  
  67.  
  68.  
  69. // Add a page number if necessary:
  70.  
  71. if ( $paged >= 2 || $page >= 2 )
  72.  
  73. echo ' | ' . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) );
  74.  
  75.  
  76.  
  77. ?></title>
  78.  
  79. <link rel="profile" href="http://gmpg.org/xfn/11" />
  80.  
  81. <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
  82.  
  83. <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
  84.  
  85. <?php
  86.  
  87. /* We add some JavaScript to pages with the comment form
  88.  
  89. * to support sites with threaded comments (when in use).
  90.  
  91. */
  92.  
  93. if ( is_singular() && get_option( 'thread_comments' ) )
  94.  
  95. wp_enqueue_script( 'comment-reply' );
  96.  
  97.  
  98.  
  99. /* Always have wp_head() just before the closing </head>
  100.  
  101. * tag of your theme, or you will break many plugins, which
  102.  
  103. * generally use this hook to add elements to <head> such
  104.  
  105. * as styles, scripts, and meta tags.
  106.  
  107. */
  108.  
  109. wp_head();
  110.  
  111. ?>
  112.  
  113. <link rel="shortcut icon" href="http://www.technologybloggers.org/images/favicon.ico">
  114. <script type="text/javascript" src="https://apis.google.com/js/plusone.js">
  115. {lang: 'en-GB'}
  116. </script>
  117. </head>
  118.  
  119.  
  120.  
  121. <body <?php body_class(); ?>>
  122.  
  123. <div id="wrapper" class="hfeed">
  124.  
  125. <div id="header">
  126.  
  127. <div id="masthead">
  128.  
  129. <div id="branding" role="banner">
  130.  
  131. <?php $heading_tag = ( is_home() || is_front_page() ) ? 'h1' : 'div'; ?>
  132.  
  133. <<?php echo $heading_tag; ?> id="site-title">
  134.  
  135. <span>
  136.  
  137. <img src="http://www.technologybloggers.org/images/Technology-Bloggers-Logo.jpg" alt="Technology Bloggers Logo" width="85" height="85" border="0"><a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
  138.  
  139. </span>
  140.  
  141. </<?php echo $heading_tag; ?>>
  142.  
  143. <div id="site-description"><strong>Read | Contribute | Benefit</strong><br />A whole community of technology bloggers</div>
  144.  
  145.  
  146.  
  147. <?php
  148.  
  149. // Check if this is a post or page, if it has a thumbnail, and if it's a big one
  150.  
  151. if ( is_singular() && current_theme_supports( 'post-thumbnails' ) &&
  152.  
  153. has_post_thumbnail( $post->ID ) &&
  154.  
  155. ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) ) &&
  156.  
  157. $image[1] >= HEADER_IMAGE_WIDTH ) :
  158.  
  159. // Houston, we have a new header image!
  160.  
  161. echo get_the_post_thumbnail( $post->ID );
  162.  
  163. elseif ( get_header_image() ) : ?>
  164.  
  165. <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />
  166.  
  167. <?php endif; ?>
  168.  
  169. </div><!-- #branding -->
  170.  
  171.  
  172.  
  173. <div id="access" role="navigation">
  174.  
  175. <?php /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?>
  176.  
  177. <div class="skip-link screen-reader-text"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentyten' ); ?>"><?php _e( 'Skip to content', 'twentyten' ); ?></a></div>
  178.  
  179. <?php /* Our navigation menu. If one isn't filled out, wp_nav_menu falls back to wp_page_menu. The menu assiged to the primary position is the one used. If none is assigned, the menu with the lowest ID is used. */ ?>
  180.  
  181. <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?>
  182.  
  183. </div><!-- #access -->
  184.  
  185. </div><!-- #masthead -->
  186.  
  187. </div><!-- #header -->
  188.  
  189.  
  190.  
  191. <div id="main">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement