Make WordPress Core

Ticket #17748: twentyeleven.patch

File twentyeleven.patch, 15.0 KB (added by dd32, 14 years ago)
  • archive.php

     
    1717                <section id="primary">
    1818                        <div id="content" role="main">
    1919
    20                                 <?php
    21                                         /* Queue the first post, that way we know
    22                                          * what date we're dealing with (if that is the case).
    23                                          *
    24                                          * We reset this later so we can run the loop
    25                                          * properly with a call to rewind_posts().
    26                                          */
    27                                         if ( have_posts() )
    28                                                 the_post();
    29                                 ?>
    30 
    3120                                <header class="page-header">
    3221                                        <h1 class="page-title">
    3322                                                <?php if ( is_day() ) : ?>
     
    4231                                        </h1>
    4332                                </header>
    4433
    45                                 <?php
    46                                         /* Since we called the_post() above, we need to
    47                                          * rewind the loop back to the beginning that way
    48                                          * we can run the loop properly, in full.
    49                                          */
    50                                         rewind_posts();
    51                                 ?>
    52 
    5334                                <?php twentyeleven_content_nav( 'nav-above' ); ?>
    5435
    5536                                <?php /* Start the Loop */ ?>
  • author.php

     
    1414
    1515                                <?php
    1616                                        /* Queue the first post, that way we know
    17                                          * what date we're dealing with (if that is the case).
     17                                         * what author we're dealing with (if that is the case).
    1818                                         *
    1919                                         * We reset this later so we can run the loop
    2020                                         * properly with a call to rewind_posts().
  • comments.php

     
    3535                        ?>
    3636                </h2>
    3737
    38                 <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
     38                <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through, WHY does the theme have to call get_option()? ?>
    3939                <nav id="comment-nav-above">
    4040                        <h1 class="assistive-text"><?php _e( 'Comment navigation', 'twentyeleven' ); ?></h1>
    4141                        <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'twentyeleven' ) ); ?></div>
  • content-aside.php

     
    1717                                <h2 class="entry-format"><?php _e( 'Aside', 'twentyeleven' ); ?></h2>
    1818                        </hgroup>
    1919
    20                         <?php if ( 'post' == $post->post_type ) : ?>
     20                        <?php if ( 'post' == get_post_type() ) : ?>
    2121                        <?php endif; ?>
    2222                       
    2323                        <?php if ( comments_open() ) : ?>
  • content-gallery.php

     
    4040                <?php if ( post_password_required() ) : ?>
    4141                        <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?>
    4242
    43                         <?php else : ?>
    44                                 <?php
    45                                         $images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) );
    46                                         if ( $images ) :
    47                                                 $total_images = count( $images );
    48                                                 $image = array_shift( $images );
    49                                                 $image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' );
    50                                 ?>
     43                <?php else : ?>
     44                        <?php
     45                                $images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) );
     46                                if ( $images ) :
     47                                        $total_images = count( $images );
     48                                        $image = array_shift( $images );
     49                                        $image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' );
     50                        ?>
    5151
    52                                 <figure class="gallery-thumb">
    53                                         <a href="<?php the_permalink(); ?>"><?php echo $image_img_tag; ?></a>
    54                                 </figure><!-- .gallery-thumb -->
     52                        <figure class="gallery-thumb">
     53                                <a href="<?php the_permalink(); ?>"><?php echo $image_img_tag; ?></a>
     54                        </figure><!-- .gallery-thumb -->
    5555
    56                                 <p><em><?php printf( _n( 'This gallery contains <a %1$s>%2$s photo</a>.', 'This gallery contains <a %1$s>%2$s photos</a>.', $total_images, 'twentyeleven' ),
    57                                                 'href="' . get_permalink() . '" title="' . sprintf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"',
    58                                                 number_format_i18n( $total_images )
    59                                         ); ?></em></p>
     56                        <p><em><?php printf( _n( 'This gallery contains <a %1$s>%2$s photo</a>.', 'This gallery contains <a %1$s>%2$s photos</a>.', $total_images, 'twentyeleven' ),
     57                                        'href="' . get_permalink() . '" title="' . sprintf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"',
     58                                        number_format_i18n( $total_images )
     59                                ); ?></em></p>
    6060                        <?php endif; ?>
    6161                        <?php the_excerpt(); ?>
    6262                <?php endif; ?>
  • content-image.php

     
    2929                </div><!-- .entry-content -->
    3030
    3131                <footer class="entry-meta">
    32                         <?php if ( 'post' == $post->post_type ) : // Hide category and tag text for pages on Search ?>
     32                        <?php if ( 'post' == get_post_type() ) : // Hide category and tag text for pages on Search ?>
    3333                        <div class="entry-meta">
    3434                                <?php
    3535                                        printf( __( '<a href="%1$s" rel="bookmark"><time class="entry-date" datetime="%2$s" pubdate>%3$s</time></a> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%4$s" title="%5$s" rel="author">%6$s</a></span>', 'twentyeleven' ),
     
    5252                                        <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list ); ?>
    5353                                </span>
    5454                                <?php endif; // End if categories ?>
     55                                <!-- What about <span class="sep"> | </span> as in the other content types? a few others lack this too -->
    5556                                <?php
    5657                                        /* translators: used between list items, there is a space after the comma */
    5758                                        $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
  • content-link.php

     
    1717                                <h2 class="entry-format"><?php _e( 'Link', 'twentyeleven' ); ?></h2>
    1818                        </hgroup>
    1919
    20                         <?php if ( 'post' == $post->post_type ) : ?>
     20                        <?php if ( 'post' == get_post_type() ) : ?>
    2121                        <?php endif; ?>
    2222
    2323                        <?php if ( comments_open() ) : ?>
  • content-quote.php

     
    1515                                <h2 class="entry-format"><?php _e( 'Quote', 'twentyeleven' ); ?></h2>
    1616                        </hgroup>
    1717
    18                         <?php if ( 'post' == $post->post_type ) : ?>
     18                        <?php if ( 'post' == get_post_type() ) : ?>
    1919                        <div class="entry-meta">
    2020                                <?php
    2121                                        printf( __( '<span class="sep">Posted on </span><a href="%1$s" rel="bookmark"><time class="entry-date" datetime="%2$s" pubdate>%3$s</time></a> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%4$s" title="%5$s" rel="author">%6$s</a></span>', 'twentyeleven' ),
     
    5050
    5151                <footer class="entry-meta">
    5252                        <?php $show_sep = false; ?>
    53                         <?php if ( 'post' == $post->post_type ) : // Hide category and tag text for pages on Search ?>
     53                        <?php if ( 'post' == get_post_type() ) : // Hide category and tag text for pages on Search ?>
    5454                        <?php
    5555                                /* translators: used between list items, there is a space after the comma */
    5656                                $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
  • content-single.php

     
    1212        <header class="entry-header">
    1313                <h1 class="entry-title"><?php the_title(); ?></h1>
    1414
     15                <?php if ( 'post' == get_post_type() ) : /* Bit of a disconnect here, Some files include this test, not all do. */ ?>
    1516                <div class="entry-meta">
    1617                        <?php
    1718                                printf( __( '<span class="sep">Posted on </span><a href="%1$s" rel="bookmark"><time class="entry-date" datetime="%2$s" pubdate>%3$s</time></a> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%4$s" title="%5$s" rel="author">%6$s</a></span>', 'twentyeleven' ),
     
    2425                                );
    2526                        ?>
    2627                </div><!-- .entry-meta -->
     28                <?php endif; ?>
    2729        </header><!-- .entry-header -->
    2830
    2931        <div class="entry-content">
  • content-status.php

     
    1515                                <h1 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></h1>
    1616                                <h2 class="entry-format"><?php _e( 'Status', 'twentyeleven' ); ?></h2>
    1717                        </hgroup>
    18 
    19                         <?php if ( 'post' == $post->post_type ) : ?>
    20                         <?php endif; ?>
    2118                       
    2219                        <?php if ( comments_open() ) : ?>
    2320                        <div class="comments-link">
     
    3229                </div><!-- .entry-summary -->
    3330                <?php else : ?>
    3431                <div class="entry-content">
    35                         <div class="avatar"><?php echo get_avatar( $post->post_author, apply_filters( 'twentyeleven_status_avatar', '65' ) ); ?></div>
     32                        <div class="avatar"><?php echo get_avatar( get_the_author_meta( 'ID' ), apply_filters( 'twentyeleven_status_avatar', '65' ) ); ?></div>
    3633                       
    3734                        <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?>
    3835                        <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyeleven' ), 'after' => '</div>' ) ); ?>
  • content.php

     
    1212                <header class="entry-header">
    1313                        <?php if ( is_sticky() ) : ?>
    1414                                <hgroup>
    15                                         <h1 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></h1>
     15                                        <h1 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) /* Y NO ARRAY! */ ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
    1616                                        <h2 class="entry-format"><?php _e( 'Featured', 'twentyeleven' ); ?></h2>
    1717                                </hgroup>
    1818                        <?php else : ?>
    1919                        <h1 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></h1>
    2020                        <?php endif; ?>
    2121
    22                         <?php if ( 'post' == $post->post_type ) : ?>
     22                        <?php if ( 'post' == get_post_type() ) : ?>
    2323                        <div class="entry-meta">
    2424                                <?php
    2525                                        printf( __( '<span class="sep">Posted on </span><a href="%1$s" rel="bookmark"><time class="entry-date" datetime="%2$s" pubdate>%3$s</time></a> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%4$s" title="%5$s" rel="author">%6$s</a></span>', 'twentyeleven' ),
     
    5353                <?php endif; ?>
    5454
    5555                <footer class="entry-meta">
    56                         <?php $show_sep = false; ?>
    57                         <?php if ( 'post' == $post->post_type ) : // Hide category and tag text for pages on Search ?>
     56                        <?php $show_sep = false; //  perhaps a implode(' | ', $utilities) could be used instead of this $show_sep business? ?>
     57                        <?php if ( 'post' == get_post_type() ) : // Hide category and tag text for pages on Search ?>
    5858                        <?php
    5959                                /* translators: used between list items, there is a space after the comma */
    6060                                $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
     
    7777                                $show_sep = true; ?>
    7878                        </span>
    7979                        <?php endif; // End if $tags_list ?>
    80                         <?php endif; // End if 'post' == $post->post_type ?>
     80                        <?php endif; // End if 'post' == get_post_type() ?>
    8181
    8282                        <?php if ( comments_open() ) : ?>
    8383                        <?php if ( $show_sep ) : ?>
  • image.php

     
    9191                                        </div><!-- .entry-content -->
    9292
    9393                                        <footer class="entry-meta">
     94                                        <!-- How come Images get this verbose Trackbacks vs. Comments text nothing else has anything like it? Trackbacks are so last century as well -->
    9495                                                <?php if ( comments_open() && pings_open() ) : // Comments and trackbacks open ?>
    9596                                                        <?php printf( __( '<a class="comment-link" href="#respond" title="Post a comment">Post a comment</a> or leave a trackback: <a class="trackback-link" href="%s" title="Trackback URL for your post" rel="trackback">Trackback URL</a>.', 'twentyeleven' ), get_trackback_url() ); ?>
    9697                                                <?php elseif ( ! comments_open() && pings_open() ) : // Only trackbacks open ?>
  • inc/theme-options.php

     
    1414 *
    1515 * @since Twenty Eleven 1.0
    1616 *
    17  * @param string $hook_suffix The action passes the current page to the function. We don't
    18  *      do anything if we're not on our theme options page.
    1917 */
    2018function twentyeleven_admin_enqueue_scripts( $hook_suffix ) {
    21         if ( $hook_suffix != 'appearance_page_theme_options' )
    22                 return;
    23 
    2419        wp_enqueue_style( 'twentyeleven-theme-options', get_template_directory_uri() . '/inc/theme-options.css', false, '2011-04-28' );
    2520        wp_enqueue_script( 'twentyeleven-theme-options', get_template_directory_uri() . '/inc/theme-options.js', array( 'farbtastic' ), '2011-04-28' );
    2621        wp_enqueue_style( 'farbtastic' );
    2722}
    28 add_action( 'admin_enqueue_scripts', 'twentyeleven_admin_enqueue_scripts' );
     23add_action( 'admin_print_styles-appearance_page_theme_options', 'twentyeleven_admin_enqueue_scripts' );
    2924
    3025/**
    3126 * Register the form setting for our twentyeleven_options array.
     
    309304
    310305        // Link color must be 3 or 6 hexadecimal characters
    311306        if ( isset( $input['link_color'] ) && preg_match( '/^#?([a-f0-9]{3}){1,2}$/i', $input['link_color'] ) )
    312                         $output['link_color'] = '#' . strtolower( ltrim( $input['link_color'], '#' ) );
     307                $output['link_color'] = '#' . strtolower( ltrim( $input['link_color'], '#' ) );
    313308
    314309        // Theme layout must be in our array of theme layout options
    315310        if ( isset( $input['theme_layout'] ) && array_key_exists( $input['theme_layout'], twentyeleven_layouts() ) )
  • single.php

     
    1212                <div id="primary">
    1313                        <div id="content" role="main">
    1414
    15                                 <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
     15                                <?php while ( have_posts() ) : the_post(); ?>
    1616
    1717                                        <nav id="nav-single">
    1818                                                <h1 class="assistive-text"><?php _e( 'Post navigation', 'twentyeleven' ); ?></h1>