Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Template Name: Sidebar Template
- * Description: A Page Template that adds a sidebar to pages
- *
- * @package WordPress
- * @subpackage Twenty_Eleven
- * @since Twenty Eleven 1.0
- */
- get_header(); ?>
- <?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 : ?>
- <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" id="large_image" alt="" />
- <?php endif; // end check for featured image or standard header ?>
- <?php endif; // end check for removed header image ?>
- <?php get_sidebar(); ?>
- <div id="primary">
- <div id="content" role="main">
- <?php while ( have_posts() ) : the_post(); ?>
- <?php get_template_part( 'content', 'page' ); ?>
- <?php endwhile; // end of the loop. ?>
- </div><!-- #content -->
- </div><!-- #primary -->
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement