Wordpress 3.5
[autoinstalls/wordpress.git] / wp-content / themes / twentyeleven / showcase.php
index 58e85e21f2d83f508cc913f6a9d12bdf61b47f4e..9bc57fc3b7930fada9686c829119ec0b160a1f8e 100644 (file)
@@ -22,7 +22,7 @@ get_header(); ?>
                <div id="primary" class="showcase">
                        <div id="content" role="main">
 
                <div id="primary" class="showcase">
                        <div id="content" role="main">
 
-                               <?php the_post(); ?>
+                               <?php while ( have_posts() ) : the_post(); ?>
 
                                <?php
                                        /**
 
                                <?php
                                        /**
@@ -33,6 +33,8 @@ get_header(); ?>
                                                get_template_part( 'content', 'intro' );
                                ?>
 
                                                get_template_part( 'content', 'intro' );
                                ?>
 
+                               <?php endwhile; ?>
+
                                <?php
                                        /**
                                         * Begin the featured posts section.
                                <?php
                                        /**
                                         * Begin the featured posts section.
@@ -64,7 +66,12 @@ get_header(); ?>
                                         */
                                        $counter_slider = 0;
 
                                         */
                                        $counter_slider = 0;
 
-                                       ?>
+                                       // Compatibility with versions of WordPress prior to 3.4.
+                                       if ( function_exists( 'get_custom_header' ) )
+                                               $header_image_width = get_theme_support( 'custom-header', 'width' );
+                                       else
+                                               $header_image_width = HEADER_IMAGE_WIDTH;
+                               ?>
 
                                <div class="featured-posts">
                                        <h1 class="showcase-heading"><?php _e( 'Featured Post', 'twentyeleven' ); ?></h1>
 
                                <div class="featured-posts">
                                        <h1 class="showcase-heading"><?php _e( 'Featured Post', 'twentyeleven' ); ?></h1>
@@ -87,10 +94,10 @@ get_header(); ?>
                                                $feature_class = 'feature-image small';
 
                                                // Hang on. Let's check this here image out.
                                                $feature_class = 'feature-image small';
 
                                                // Hang on. Let's check this here image out.
-                                               $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( HEADER_IMAGE_WIDTH, HEADER_IMAGE_WIDTH ) );
+                                               $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) );
 
                                                // Is it bigger than or equal to our header?
 
                                                // Is it bigger than or equal to our header?
-                                               if ( $image[1] >= HEADER_IMAGE_WIDTH ) {
+                                               if ( $image[1] >= $header_image_width ) {
                                                        // If bigger, let's add a BIGGER class. It's EXTRA classy now.
                                                        $feature_class = 'feature-image large';
                                                }
                                                        // If bigger, let's add a BIGGER class. It's EXTRA classy now.
                                                        $feature_class = 'feature-image large';
                                                }
@@ -105,12 +112,12 @@ get_header(); ?>
                                                         * make it a large featured post, otherwise render it small
                                                         */
                                                        if ( has_post_thumbnail() ) {
                                                         * make it a large featured post, otherwise render it small
                                                         */
                                                        if ( has_post_thumbnail() ) {
-                                                               if ( $image[1] >= HEADER_IMAGE_WIDTH )
+                                                               if ( $image[1] >= $header_image_width )
                                                                        $thumbnail_size = 'large-feature';
                                                                else
                                                                        $thumbnail_size = 'small-feature';
                                                                ?>
                                                                        $thumbnail_size = 'large-feature';
                                                                else
                                                                        $thumbnail_size = 'small-feature';
                                                                ?>
-                                                               <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_post_thumbnail( $thumbnail_size ); ?></a>
+                                                               <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_post_thumbnail( $thumbnail_size ); ?></a>
                                                                <?php
                                                        }
                                                ?>
                                                                <?php
                                                        }
                                                ?>
@@ -140,7 +147,7 @@ get_header(); ?>
                                                        else
                                                                $class = '';
                                        ?>
                                                        else
                                                                $class = '';
                                        ?>
-                                               <li><a href="#featured-post-<?php echo $counter_slider; ?>" title="<?php printf( esc_attr__( 'Featuring: %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" <?php echo $class; ?>></a></li>
+                                               <li><a href="#featured-post-<?php echo $counter_slider; ?>" title="<?php echo esc_attr( sprintf( __( 'Featuring: %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" <?php echo $class; ?>></a></li>
                                        <?php endwhile; ?>
                                        </ul>
                                </nav>
                                        <?php endwhile; ?>
                                        </ul>
                                </nav>
@@ -189,7 +196,7 @@ get_header(); ?>
                                        while ( $recent->have_posts() ) : $recent->the_post(); ?>
 
                                                <li class="entry-title">
                                        while ( $recent->have_posts() ) : $recent->the_post(); ?>
 
                                                <li class="entry-title">
-                                                       <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
+                                                       <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
                                                        <span class="comments-link">
                                                                <?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentyeleven' ) . '</span>', __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?>
                                                        </span>
                                                        <span class="comments-link">
                                                                <?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentyeleven' ) . '</span>', __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?>
                                                        </span>