Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #8 from dslatten/patch-1

Excellent addition.
  • Loading branch information...
commit 89ec154fe1039aa101062605410957679c5dd974 2 parents 189c99e + 3a6d7d8
@brianpurkiss brianpurkiss authored
Showing with 20 additions and 3 deletions.
  1. +20 −3 whiteboard/header.php
View
23 whiteboard/header.php
@@ -54,9 +54,26 @@
<h3 id="tagline"><?php bloginfo('description'); ?></h3>
<?php } ?>
</div><!--#title-->
- <div id="header-image" class="container">
- <img src="<?php header_image(); ?>" alt="<?php bloginfo('name'); ?>" />
- </div><!--#header-image-->
+ <?php
+ // Check to see if the header image has been removed
+ $header_image = get_header_image();
+ if ( ! empty( $header_image ) ) :
+ ?>
+ <?php
+ // The header image
+ // Check if this is a post or page, if it has a thumbnail, and if it's a big one
+ if ( is_singular() &&
+ has_post_thumbnail( $post->ID ) &&
+ ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( HEADER_IMAGE_WIDTH, HEADER_IMAGE_WIDTH ) ) ) &&
+ $image[1] >= HEADER_IMAGE_WIDTH ) :
+ // Houston, we have a new header image!
+ echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
+ else : ?>
+ <div id="header-image" class="container">
+ <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="<?php bloginfo('name'); ?>" />
+ </div><!--#header-image-->
+ <?php endif; // end check for featured image or standard header ?>
+ <?php endif; // end check for removed header image ?>
<div id="nav-primary" class="nav"><nav>
<?php if ( is_user_logged_in() ) {
wp_nav_menu( array( 'theme_location' => 'logged-in-menu' ) ); /* if the visitor is logged in, this primary navigation will be displayed */
Please sign in to comment.
Something went wrong with that request. Please try again.