<!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 &quot;RSS for this post&quot; 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 &lt;a href=&quot;%1$s&quot; title=&quot;Link to full-size image&quot;&gt;%2$s &amp;times; %3$s&lt;/a&gt;', 'twentyten'),
+                                                                        wp_get_attachment_url(),
+                                                                        $size[0],
+                                                                        $size[1]
+                                                                );
+                                                        }                                                        
</ins><span class="cx">                                                 ?&gt;
</span><span class="cx">                                                 &lt;?php edit_post_link( __( 'Edit', 'twentyten' ), '&lt;span class=&quot;meta-sep&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;edit-link&quot;&gt;', '&lt;/span&gt;' ); ?&gt;
</span><span class="cx">                                         &lt;/div&gt;&lt;!-- .entry-meta --&gt;
</span><span class="lines">@@ -41,8 +49,9 @@
</span><span class="cx">                                         &lt;div class=&quot;entry-content&quot;&gt;
</span><span class="cx">                                                 &lt;div class=&quot;entry-attachment&quot;&gt;
</span><span class="cx"> &lt;?php if ( wp_attachment_is_image() ) : ?&gt;
</span><del>-                                                &lt;p class=&quot;attachment&quot;&gt;&lt;a href=&quot;&lt;?php echo wp_get_attachment_url(); ?&gt;&quot; title=&quot;&lt;?php echo esc_attr( get_the_title() ); ?&gt;&quot; rel=&quot;attachment&quot;&gt;&lt;?php
-                                                        echo wp_get_attachment_image( $post-&gt;ID, array( $content_width, $content_width ) ); // max $content_width wide or high.
</del><ins>+                                                &lt;p class=&quot;attachment&quot;&gt;&lt;a href=&quot;&lt;?php echo twentyten_get_next_attachment_url(); ?&gt;&quot; title=&quot;&lt;?php echo esc_attr( get_the_title() ); ?&gt;&quot; rel=&quot;attachment&quot;&gt;&lt;?php
+                                                        $attachment_size = apply_filters( 'twentyten_attachment_size',  900 );
+                                                        echo wp_get_attachment_image( $post-&gt;ID, array( $attachment_size, 9999 ) ); // filterable image width with, essentially, no limit for image height.
</ins><span class="cx">                                                 ?&gt;&lt;/a&gt;&lt;/p&gt;
</span><span class="cx"> 
</span><span class="cx">                                                 &lt;div id=&quot;nav-below&quot; class=&quot;navigation&quot;&gt;
</span><span class="lines">@@ -64,9 +73,9 @@
</span><span class="cx">                                         &lt;?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 &lt;a href=&quot;%3$s&quot; title=&quot;Permalink to %4$s&quot; rel=&quot;bookmark&quot;&gt;permalink&lt;/a&gt;. Follow any comments here with the &lt;a href=&quot;%5$s&quot; title=&quot;Comments RSS to %4$s&quot; rel=&quot;alternate&quot; type=&quot;application/rss+xml&quot;&gt;RSS feed for this post&lt;/a&gt;.', 'twentyten' );
</del><ins>+                                                        $utility_text = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the &lt;a href=&quot;%3$s&quot; title=&quot;Permalink to %4$s&quot; rel=&quot;bookmark&quot;&gt;permalink&lt;/a&gt;.', 'twentyten' );
</ins><span class="cx">                                                 } else {
</span><del>-                                                        $utility_text = __( 'This entry was posted in %1$s. Bookmark the &lt;a href=&quot;%3$s&quot; title=&quot;Permalink to %4$s&quot; rel=&quot;bookmark&quot;&gt;permalink&lt;/a&gt;. Follow any comments here with the &lt;a href=&quot;%5$s&quot; title=&quot;Comments RSS to %4$s&quot; rel=&quot;alternate&quot; type=&quot;application/rss+xml&quot;&gt;RSS feed for this post&lt;/a&gt;.', 'twentyten' );
</del><ins>+                                                        $utility_text = __( 'This entry was posted in %1$s. Bookmark the &lt;a href=&quot;%3$s&quot; title=&quot;Permalink to %4$s&quot; rel=&quot;bookmark&quot;&gt;permalink&lt;/a&gt;.', '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">                         &lt;/div&gt;&lt;!-- #content --&gt;
</span><span class="cx">                 &lt;/div&gt;&lt;!-- #container --&gt;
</span><span class="cx"> 
</span><del>-&lt;?php get_sidebar(); ?&gt;
</del><span class="cx"> &lt;?php get_footer(); ?&gt;
</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-&gt;get_queried_object();
-        $terms = wp_get_object_terms( $post-&gt;ID, $taxonomy );
-        // If we're viewing a Taxonomy page..
-        if ( isset( $current_term-&gt;taxonomy ) &amp;&amp; $taxonomy == $current_term-&gt;taxonomy ) {
-                // Remove the term from display.
-                foreach ( (array) $terms as $key =&gt; $term ) {
-                        if ( $term-&gt;term_id == $current_term-&gt;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=&quot;category&quot;' : 'rel=&quot;tag&quot;';
-        foreach ( (array) $terms as $term ) {
-                $tlist[] = '&lt;a href=&quot;' . get_term_link( $term, $taxonomy ) . '&quot; title=&quot;' . esc_attr( sprintf( __( 'View all posts in %s', 'twentyten' ), $term-&gt;name ) ) . '&quot; ' . $rel . '&gt;' . $term-&gt;name . '&lt;/a&gt;';
-        }
-        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-&gt;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' =&gt; $post-&gt;post_parent, 'post_status' =&gt; 'inherit', 'post_type' =&gt; 'attachment', 'post_mime_type' =&gt; 'image', 'order' =&gt; 'ASC', 'orderby' =&gt; 'menu_order ID') ));

+        foreach ( $attachments as $k =&gt; $attachment )
+                if ( $attachment-&gt;ID == $post-&gt;ID )
+                        break;
+
+                $k = $k + 1;
+  
+                if ( isset($attachments[$k]) ) {
+                        return get_attachment_link($attachments[$k]-&gt;ID);                
+                } else {
+                        return get_permalink($post-&gt;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">         &lt;?php endif; ?&gt;
</span><span class="cx"> 
</span><span class="cx">                         &lt;div class=&quot;entry-utility&quot;&gt;
</span><del>-                                &lt;span class=&quot;cat-links&quot;&gt;&lt;span class=&quot;entry-utility-prep entry-utility-prep-cat-links&quot;&gt;&lt;?php echo twentyten_cat_list(); ?&gt;&lt;/span&gt;&lt;/span&gt;
</del><ins>+                                &lt;span class=&quot;cat-links&quot;&gt;&lt;span class=&quot;entry-utility-prep entry-utility-prep-cat-links&quot;&gt;&lt;?php _e( 'Posted in ', 'twentyten' ); ?&gt;&lt;/span&gt;&lt;?php the_category( ', ' ); ?&gt;&lt;/span&gt;
</ins><span class="cx">                                 &lt;span class=&quot;meta-sep&quot;&gt; | &lt;/span&gt;
</span><del>-                                &lt;?php $tags_text = twentyten_tag_list(); ?&gt;
-                                &lt;?php if ( ! empty( $tags_text ) ) : ?&gt;
-                                &lt;span class=&quot;tag-links&quot;&gt;&lt;span class=&quot;entry-utility-prep entry-utility-prep-tag-links&quot;&gt;&lt;?php echo $tags_text; ?&gt;&lt;/span&gt;&lt;/span&gt;
-                                &lt;span class=&quot;meta-sep&quot;&gt; | &lt;/span&gt;
-                                &lt;?php endif; //$tags_text ?&gt;
</del><ins>+                                &lt;?php the_tags( '&lt;span class=&quot;tag-links&quot;&gt;&lt;span class=&quot;entry-utility-prep entry-utility-prep-tag-links&quot;&gt;' . __( 'Tagged ', 'twentyten' ) . '&lt;/span&gt;', ', ', '&lt;span class=&quot;meta-sep&quot;&gt; | &lt;/span&gt;' ); ?&gt;
</ins><span class="cx">                                 &lt;span class=&quot;comments-link&quot;&gt;&lt;?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?&gt;&lt;/span&gt;
</span><span class="cx">                                 &lt;?php edit_post_link( __( 'Edit', 'twentyten' ), '&lt;span class=&quot;meta-sep&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;edit-link&quot;&gt;', '&lt;/span&gt;' ); ?&gt;
</span><span class="cx">                         &lt;/div&gt;&lt;!-- #entry-utility --&gt;
</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">                                         &lt;?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 &lt;a href=&quot;%3$s&quot; title=&quot;Permalink to %4$s&quot; rel=&quot;bookmark&quot;&gt;permalink&lt;/a&gt;. Follow any comments here with the &lt;a href=&quot;%5$s&quot; title=&quot;Comments RSS to %4$s&quot; rel=&quot;alternate&quot; type=&quot;application/rss+xml&quot;&gt;RSS feed for this post&lt;/a&gt;.', 'twentyten' );
</del><ins>+                                                        $utility_text = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the &lt;a href=&quot;%3$s&quot; title=&quot;Permalink to %4$s&quot; rel=&quot;bookmark&quot;&gt;permalink&lt;/a&gt;.', 'twentyten' );
</ins><span class="cx">                                                 } else {
</span><del>-                                                        $utility_text = __( 'This entry was posted in %1$s. Bookmark the &lt;a href=&quot;%3$s&quot; title=&quot;Permalink to %4$s&quot; rel=&quot;bookmark&quot;&gt;permalink&lt;/a&gt;. Follow any comments here with the &lt;a href=&quot;%5$s&quot; title=&quot;Comments RSS to %4$s&quot; rel=&quot;alternate&quot; type=&quot;application/rss+xml&quot;&gt;RSS feed for this post&lt;/a&gt;.', 'twentyten' );
</del><ins>+                                                        $utility_text = __( 'This entry was posted in %1$s. Bookmark the &lt;a href=&quot;%3$s&quot; title=&quot;Permalink to %4$s&quot; rel=&quot;bookmark&quot;&gt;permalink&lt;/a&gt;.', '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">                                         ?&gt;
</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>