PageRenderTime 46ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

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

https://bitbucket.org/sergiohzlz/reportaprod
PHP | 59 lines | 45 code | 4 blank | 10 comment | 6 complexity | b660ea8850a4ee811a7bce284df48684 MD5 | raw file
Possible License(s): GPL-2.0, GPL-3.0, AGPL-1.0, LGPL-2.1
  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 Vostok
  9. */
  10. ?><!DOCTYPE html>
  11. <html <?php language_attributes(); ?>>
  12. <head>
  13. <meta charset="<?php bloginfo( 'charset' ); ?>" />
  14. <title><?php wp_title(); ?> <?php bloginfo('name'); ?></title>
  15. <link rel="profile" href="http://gmpg.org/xfn/11" />
  16. <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
  17. <?php if ( is_singular() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); ?>
  18. <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
  19. <?php wp_head(); ?>
  20. </head>
  21. <body <?php body_class(); ?>>
  22. <div id="wrapper" class="hfeed">
  23. <div id="header">
  24. <div id="masthead">
  25. <div id="branding" role="banner">
  26. <?php $heading_tag = ( is_home() || is_front_page() ) ? 'h1' : 'div'; ?>
  27. <<?php echo $heading_tag; ?> id="site-title">
  28. <span>
  29. <a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
  30. </span>
  31. </<?php echo $heading_tag; ?>>
  32. <div id="site-description"><?php bloginfo( 'description' ); ?></div>
  33. <?php $vostok_options = get_option('vostok_theme_options'); ?>
  34. <?php if ( $vostok_options['show-header-image'] ) :
  35. // Check if this is a post or page, if it has a thumbnail, and if it's a big one
  36. if ( is_singular() &&
  37. has_post_thumbnail( $post->ID ) &&
  38. ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) ) &&
  39. $image[1] >= HEADER_IMAGE_WIDTH ) :
  40. // Houston, we have a new header image!
  41. echo get_the_post_thumbnail( $post->ID );
  42. elseif ( get_header_image() ) : ?>
  43. <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />
  44. <?php endif; ?>
  45. <?php endif; // end show-header-image check ?>
  46. </div><!-- #branding -->
  47. <div id="access" role="navigation">
  48. <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>
  49. <?php if ( $vostok_options['show-header-nav'] ) : ?>
  50. <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?>
  51. <?php endif; ?>
  52. </div><!-- #access -->
  53. </div><!-- #masthead -->
  54. </div><!-- #header -->
  55. <div id="main">