<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[14384] trunk/wp-content/themes/twentyten: In Twenty Ten:</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/14384">14384</a></dd>
<dt>Author</dt> <dd>iammattthomas</dd>
<dt>Date</dt> <dd>2010-05-03 19:16:47 +0000 (Mon, 03 May 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>In Twenty Ten:
* removed custom functions for listing tags, cats, or other custom taxonomy terms.
* fixed up a couple of span tags meant to catch the text before tag and cat listings (for child themes)
* made attachment pages full width with a filterable size for the image, 'twentyten_attachment_size' (for child themes)
* removed "RSS for this post" in single.php.
clicking on attachment images in a gallery takes you to the next image, unless it's the last image in a gallery, in which case it points you back to the parent post.
* added a link to the full-size image in the post meta
Props iandstewart.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpcontentthemestwentytenattachmentphp">trunk/wp-content/themes/twentyten/attachment.php</a></li>
<li><a href="#trunkwpcontentthemestwentytenfunctionsphp">trunk/wp-content/themes/twentyten/functions.php</a></li>
<li><a href="#trunkwpcontentthemestwentytenloopphp">trunk/wp-content/themes/twentyten/loop.php</a></li>
<li><a href="#trunkwpcontentthemestwentytensinglephp">trunk/wp-content/themes/twentyten/single.php</a></li>
<li><a href="#trunkwpcontentthemestwentytenstylecss">trunk/wp-content/themes/twentyten/style.css</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpcontentthemestwentytenattachmentphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-content/themes/twentyten/attachment.php (14383 => 14384)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-content/themes/twentyten/attachment.php        2010-05-03 19:12:19 UTC (rev 14383)
+++ trunk/wp-content/themes/twentyten/attachment.php        2010-05-03 19:16:47 UTC (rev 14384)
</span><span class="lines">@@ -34,6 +34,14 @@
</span><span class="cx">                                                                 esc_attr( get_the_time() ),
</span><span class="cx">                                                                 get_the_date()
</span><span class="cx">                                                         );
</span><ins>+                                                        if ( wp_attachment_is_image() ) {
+                                                                $size = getimagesize( wp_get_attachment_url() );
+                                                                printf( __( ' at <a href="%1$s" title="Link to full-size image">%2$s &times; %3$s</a>', 'twentyten'),
+                                                                        wp_get_attachment_url(),
+                                                                        $size[0],
+                                                                        $size[1]
+                                                                );
+                                                        }                                                        
</ins><span class="cx">                                                 ?>
</span><span class="cx">                                                 <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
</span><span class="cx">                                         </div><!-- .entry-meta -->
</span><span class="lines">@@ -41,8 +49,9 @@
</span><span class="cx">                                         <div class="entry-content">
</span><span class="cx">                                                 <div class="entry-attachment">
</span><span class="cx"> <?php if ( wp_attachment_is_image() ) : ?>
</span><del>-                                                <p class="attachment"><a href="<?php echo wp_get_attachment_url(); ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php
-                                                        echo wp_get_attachment_image( $post->ID, array( $content_width, $content_width ) ); // max $content_width wide or high.
</del><ins>+                                                <p class="attachment"><a href="<?php echo twentyten_get_next_attachment_url(); ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php
+                                                        $attachment_size = apply_filters( 'twentyten_attachment_size', 900 );
+                                                        echo wp_get_attachment_image( $post->ID, array( $attachment_size, 9999 ) ); // filterable image width with, essentially, no limit for image height.
</ins><span class="cx">                                                 ?></a></p>
</span><span class="cx">
</span><span class="cx">                                                 <div id="nav-below" class="navigation">
</span><span class="lines">@@ -64,9 +73,9 @@
</span><span class="cx">                                         <?php
</span><span class="cx">                                                 $tag_list = get_the_tag_list();
</span><span class="cx">                                                 if ( '' != $tag_list ) {
</span><del>-                                                        $utility_text = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>. Follow any comments here with the <a href="%5$s" title="Comments RSS to %4$s" rel="alternate" type="application/rss+xml">RSS feed for this post</a>.', 'twentyten' );
</del><ins>+                                                        $utility_text = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyten' );
</ins><span class="cx">                                                 } else {
</span><del>-                                                        $utility_text = __( 'This entry was posted in %1$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>. Follow any comments here with the <a href="%5$s" title="Comments RSS to %4$s" rel="alternate" type="application/rss+xml">RSS feed for this post</a>.', 'twentyten' );
</del><ins>+                                                        $utility_text = __( 'This entry was posted in %1$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyten' );
</ins><span class="cx">                                                 }
</span><span class="cx">                                                 printf(
</span><span class="cx">                                                         $utility_text,
</span><span class="lines">@@ -96,5 +105,4 @@
</span><span class="cx">                         </div><!-- #content -->
</span><span class="cx">                 </div><!-- #container -->
</span><span class="cx">
</span><del>-<?php get_sidebar(); ?>
</del><span class="cx"> <?php get_footer(); ?>
</span></span></pre></div>
<a id="trunkwpcontentthemestwentytenfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-content/themes/twentyten/functions.php (14383 => 14384)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-content/themes/twentyten/functions.php        2010-05-03 19:12:19 UTC (rev 14383)
+++ trunk/wp-content/themes/twentyten/functions.php        2010-05-03 19:16:47 UTC (rev 14384)
</span><span class="lines">@@ -284,78 +284,7 @@
</span><span class="cx"> }
</span><span class="cx"> endif;
</span><span class="cx">
</span><del>-if ( ! function_exists( 'twentyten_cat_list' ) ) :
</del><span class="cx"> /**
</span><del>- * Returns the list of categories
- *
- * Returns the list of categories based on if we are or are
- * not browsing a category archive page.
- *
- * @uses twentyten_term_list
- *
- * @return string
- */
-function twentyten_cat_list() {
-        return twentyten_term_list( 'category', ', ', __( 'Posted in %s', 'twentyten' ), __( 'Also posted in %s', 'twentyten' ) );
-}
-endif;
-
-if ( ! function_exists( 'twentyten_tag_list' ) ) :
-/**
- * Returns the list of tags
- *
- * Returns the list of tags based on if we are or are not
- * browsing a tag archive page
- *
- * @uses twentyten_term_list
- *
- * @return string
- */
-function twentyten_tag_list() {
-        return twentyten_term_list( 'post_tag', ', ', __( 'Tagged %s', 'twentyten' ), __( 'Also tagged %s', 'twentyten' ) );
-}
-endif;
-
-
-if ( ! function_exists( 'twentyten_term_list' ) ) :
-/**
- * Returns the list of taxonomy items in multiple ways
- *
- * Returns the list of taxonomy items differently based on
- * if we are browsing a term archive page or a different
- * type of page. If browsing a term archive page and the
- * post has no other taxonomied terms, it returns empty
- *
- * @return string
- */
-function twentyten_term_list( $taxonomy, $glue = ', ', $text = '', $also_text = '' ) {
-        global $wp_query, $post;
-        $current_term = $wp_query->get_queried_object();
-        $terms = wp_get_object_terms( $post->ID, $taxonomy );
-        // If we're viewing a Taxonomy page..
-        if ( isset( $current_term->taxonomy ) && $taxonomy == $current_term->taxonomy ) {
-                // Remove the term from display.
-                foreach ( (array) $terms as $key => $term ) {
-                        if ( $term->term_id == $current_term->term_id ) {
-                                unset( $terms[$key] );
-                                break;
-                        }
-                }
-                // Change to Also text as we've now removed something from the terms list.
-                $text = $also_text;
-        }
-        $tlist = array();
-        $rel = 'category' == $taxonomy ? 'rel="category"' : 'rel="tag"';
-        foreach ( (array) $terms as $term ) {
-                $tlist[] = '<a href="' . get_term_link( $term, $taxonomy ) . '" title="' . esc_attr( sprintf( __( 'View all posts in %s', 'twentyten' ), $term->name ) ) . '" ' . $rel . '>' . $term->name . '</a>';
-        }
-        if ( ! empty( $tlist ) )
-                return sprintf( $text, join( $glue, $tlist ) );
-        return '';
-}
-endif;
-
-/**
</del><span class="cx"> * Register widgetized areas, including two sidebars and four widget-ready columns in the footer.
</span><span class="cx"> *
</span><span class="cx"> * To override twentyten_widgets_init() in a child theme, remove the action hook and add your own
</span><span class="lines">@@ -439,3 +368,24 @@
</span><span class="cx">         remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) );
</span><span class="cx"> }
</span><span class="cx"> add_action( 'widgets_init', 'twentyten_remove_recent_comments_style' );
</span><ins>+
+/**
+ * Get the URL of the next image in a gallery for attachment pages
+ */
+function twentyten_get_next_attachment_url() {
+        global $post;
+        $post = get_post($post);
+        $attachments = array_values(get_children( array('post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID') ));
+
+        foreach ( $attachments as $k => $attachment )
+                if ( $attachment->ID == $post->ID )
+                        break;
+
+                $k = $k + 1;
+
+                if ( isset($attachments[$k]) ) {
+                        return get_attachment_link($attachments[$k]->ID);                
+                } else {
+                        return get_permalink($post->post_parent);
+                }
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpcontentthemestwentytenloopphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-content/themes/twentyten/loop.php (14383 => 14384)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-content/themes/twentyten/loop.php        2010-05-03 19:12:19 UTC (rev 14383)
+++ trunk/wp-content/themes/twentyten/loop.php        2010-05-03 19:16:47 UTC (rev 14384)
</span><span class="lines">@@ -142,13 +142,9 @@
</span><span class="cx">         <?php endif; ?>
</span><span class="cx">
</span><span class="cx">                         <div class="entry-utility">
</span><del>-                                <span class="cat-links"><span class="entry-utility-prep entry-utility-prep-cat-links"><?php echo twentyten_cat_list(); ?></span></span>
</del><ins>+                                <span class="cat-links"><span class="entry-utility-prep entry-utility-prep-cat-links"><?php _e( 'Posted in ', 'twentyten' ); ?></span><?php the_category( ', ' ); ?></span>
</ins><span class="cx">                                 <span class="meta-sep"> | </span>
</span><del>-                                <?php $tags_text = twentyten_tag_list(); ?>
-                                <?php if ( ! empty( $tags_text ) ) : ?>
-                                <span class="tag-links"><span class="entry-utility-prep entry-utility-prep-tag-links"><?php echo $tags_text; ?></span></span>
-                                <span class="meta-sep"> | </span>
-                                <?php endif; //$tags_text ?>
</del><ins>+                                <?php the_tags( '<span class="tag-links"><span class="entry-utility-prep entry-utility-prep-tag-links">' . __( 'Tagged ', 'twentyten' ) . '</span>', ', ', '<span class="meta-sep"> | </span>' ); ?>
</ins><span class="cx">                                 <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span>
</span><span class="cx">                                 <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
</span><span class="cx">                         </div><!-- #entry-utility -->
</span></span></pre></div>
<a id="trunkwpcontentthemestwentytensinglephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-content/themes/twentyten/single.php (14383 => 14384)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-content/themes/twentyten/single.php        2010-05-03 19:12:19 UTC (rev 14383)
+++ trunk/wp-content/themes/twentyten/single.php        2010-05-03 19:16:47 UTC (rev 14384)
</span><span class="lines">@@ -54,17 +54,16 @@
</span><span class="cx">                                         <?php
</span><span class="cx">                                                 $tag_list = get_the_tag_list('', ', ');
</span><span class="cx">                                                 if ( '' != $tag_list ) {
</span><del>-                                                        $utility_text = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>. Follow any comments here with the <a href="%5$s" title="Comments RSS to %4$s" rel="alternate" type="application/rss+xml">RSS feed for this post</a>.', 'twentyten' );
</del><ins>+                                                        $utility_text = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyten' );
</ins><span class="cx">                                                 } else {
</span><del>-                                                        $utility_text = __( 'This entry was posted in %1$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>. Follow any comments here with the <a href="%5$s" title="Comments RSS to %4$s" rel="alternate" type="application/rss+xml">RSS feed for this post</a>.', 'twentyten' );
</del><ins>+                                                        $utility_text = __( 'This entry was posted in %1$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyten' );
</ins><span class="cx">                                                 }
</span><span class="cx">                                                 printf(
</span><span class="cx">                                                         $utility_text,
</span><span class="cx">                                                         get_the_category_list( ', ' ),
</span><span class="cx">                                                         $tag_list,
</span><span class="cx">                                                         get_permalink(),
</span><del>-                                                        the_title_attribute( 'echo=0' ),
-                                                        get_post_comments_feed_link()
</del><ins>+                                                        the_title_attribute( 'echo=0' )
</ins><span class="cx">                                                 );
</span><span class="cx">                                         ?>
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpcontentthemestwentytenstylecss"></a>
<div class="modfile"><h4>Modified: trunk/wp-content/themes/twentyten/style.css (14383 => 14384)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-content/themes/twentyten/style.css        2010-05-03 19:12:19 UTC (rev 14383)
+++ trunk/wp-content/themes/twentyten/style.css        2010-05-03 19:16:47 UTC (rev 14384)
</span><span class="lines">@@ -92,8 +92,17 @@
</span><span class="cx">         width: 640px;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+/*
+LAYOUT: Full width, no sidebar
+DESCRIPTION: Full width content with no sidebar; used for attachment pages
+*/
</ins><span class="cx">
</span><ins>+.single-attachment #content {
+        margin: 0 auto;
+        width: 900px;
+}
</ins><span class="cx">
</span><ins>+
</ins><span class="cx"> /* =Fonts
</span><span class="cx"> -------------------------------------------------------------- */
</span><span class="cx"> body,
</span><span class="lines">@@ -762,6 +771,9 @@
</span><span class="cx">         margin: 0;
</span><span class="cx">         max-width: 640px;
</span><span class="cx"> }
</span><ins>+.single-attachment #content img {
+        max-width: 900px;
+}
</ins><span class="cx"> #content .alignleft,
</span><span class="cx"> #content img.alignleft {
</span><span class="cx">         display: inline;
</span><span class="lines">@@ -811,7 +823,7 @@
</span><span class="cx"> }
</span><span class="cx"> #content .gallery .gallery-item {
</span><span class="cx">         float: left;
</span><del>-        margin-top: 10px;
</del><ins>+        margin-top: 0;
</ins><span class="cx">         text-align: center;
</span><span class="cx">         width: 33%;
</span><span class="cx"> }
</span><span class="lines">@@ -819,7 +831,9 @@
</span><span class="cx">         border: 2px solid #cfcfcf;
</span><span class="cx"> }
</span><span class="cx"> #content .gallery .gallery-caption {
</span><del>-        margin-left: 0;
</del><ins>+        color: #888;
+        font-size: 12px;
+        margin: 0 0 12px;
</ins><span class="cx"> }
</span><span class="cx"> #content .gallery dl {
</span><span class="cx">         margin: 0;
</span><span class="lines">@@ -827,11 +841,6 @@
</span><span class="cx"> #content .gallery img {
</span><span class="cx">         border: 10px solid #f1f1f1;
</span><span class="cx"> }
</span><del>-#content .gallery-caption {
-        color: #888;
-        font-size: 12px;
-        margin:-24px 0 24px 0;
-}
</del><span class="cx"> #content .gallery br+br {
</span><span class="cx">         display: none;
</span><span class="cx"> }
</span></span></pre>
</div>
</div>
</body>
</html>