PageRenderTime 41ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/blog/wp-content/themes/coraline/header.php

https://bitbucket.org/sergiohzlz/reportaprod
PHP | 99 lines | 66 code | 10 blank | 23 comment | 12 complexity | b4dc0be1666e66833136ff7e881bff01 MD5 | raw file
Possible License(s): GPL-2.0, GPL-3.0, AGPL-1.0, LGPL-2.1
  1. <?php
  2. /**
  3. * @package WordPress
  4. * @subpackage Coraline
  5. * @since Coraline 1.0
  6. */
  7. ?><!DOCTYPE html>
  8. <!--[if IE 6]>
  9. <html id="ie6" <?php language_attributes(); ?>>
  10. <![endif]-->
  11. <!--[if (gt IE 6) | (!IE)]><!-->
  12. <html <?php language_attributes(); ?>>
  13. <!--<![endif]-->
  14. <head>
  15. <meta charset="<?php bloginfo( 'charset' ); ?>" />
  16. <title><?php
  17. /*
  18. * Print the <title> tag based on what is being viewed.
  19. */
  20. global $page, $paged;
  21. wp_title( '|', true, 'right' );
  22. // Add the blog name.
  23. bloginfo( 'name' );
  24. // Add the blog description for the home/front page.
  25. $site_description = get_bloginfo( 'description', 'display' );
  26. if ( $site_description && ( is_home() || is_front_page() ) )
  27. echo " | $site_description";
  28. // Add a page number if necessary:
  29. if ( $paged >= 2 || $page >= 2 )
  30. echo ' | ' . sprintf( __( 'Page %s', 'coraline' ), max( $paged, $page ) );
  31. ?></title>
  32. <link rel="profile" href="http://gmpg.org/xfn/11" />
  33. <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
  34. <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
  35. <?php
  36. /* We add some JavaScript to pages with the comment form
  37. * to support sites with threaded comments (when in use).
  38. */
  39. if ( is_singular() && get_option( 'thread_comments' ) )
  40. wp_enqueue_script( 'comment-reply' );
  41. /* Always have wp_head() just before the closing </head>
  42. * tag of your theme, or you will break many plugins, which
  43. * generally use this hook to add elements to <head> such
  44. * as styles, scripts, and meta tags.
  45. */
  46. wp_head();
  47. ?>
  48. </head>
  49. <body <?php body_class(); ?>>
  50. <div id="container" class="hfeed">
  51. <div id="header">
  52. <div id="masthead" role="banner">
  53. <?php $heading_tag = ( is_home() || is_front_page() ) ? 'h1' : 'div'; ?>
  54. <<?php echo $heading_tag; ?> id="site-title">
  55. <span>
  56. <a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
  57. </span>
  58. </<?php echo $heading_tag; ?>>
  59. <div id="site-description"><?php bloginfo( 'description' ); ?></div>
  60. </div><!-- #masthead -->
  61. <div id="access" role="navigation">
  62. <?php /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?>
  63. <div class="skip-link screen-reader-text"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'coraline' ); ?>"><?php _e( 'Skip to content', 'coraline' ); ?></a></div>
  64. <?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. */ ?>
  65. <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?>
  66. </div><!-- #access -->
  67. <div id="branding">
  68. <?php
  69. // Check to see if the header image has been removed
  70. if ( get_header_image() != '' ) :
  71. ?>
  72. <a href="<?php echo home_url( '/' ); ?>">
  73. <?php
  74. // The header image
  75. // Check if this is a post or page, if it has a thumbnail, and if it's a big one
  76. if ( is_singular() &&
  77. has_post_thumbnail( $post->ID ) &&
  78. ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) ) &&
  79. $image[1] >= HEADER_IMAGE_WIDTH ) :
  80. // Houston, we have a new header image!
  81. echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
  82. else : ?>
  83. <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />
  84. <?php endif; // end check for featured image or standard header ?>
  85. </a>
  86. <?php endif; // end check for removed header image ?>
  87. </div><!-- #branding -->
  88. </div><!-- #header -->
  89. <div id="content-box">