Changeset 13720 for trunk/wp-content/themes/twentyten/functions.php
- Timestamp:
- 03/16/2010 08:17:22 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-content/themes/twentyten/functions.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/themes/twentyten/functions.php
r13552 r13720 9 9 // Your Changeable header business starts here 10 10 // No CSS, just IMG call 11 define( 'HEADER_TEXTCOLOR', '' );12 define( 'HEADER_IMAGE', '%s/images/headers/forestfloor.jpg' ); // %s is theme dir uri11 define( 'HEADER_TEXTCOLOR', '' ); 12 define( 'HEADER_IMAGE', '%s/images/headers/forestfloor.jpg' ); // %s is theme dir uri 13 13 define( 'HEADER_IMAGE_WIDTH', apply_filters( 'twentyten_header_image_width', 940 ) ); 14 14 define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'twentyten_header_image_height', 198 ) ); … … 18 18 // and thus ends the changeable header business 19 19 20 register_default_headers( array('berries' => array('url' => '%s/images/headers/berries.jpg', 'thumbnail_url' => '%s/images/headers/berries-thumbnail.jpg', 'description' => __('Berries')), 21 'cherryblossom' => array( 'url' => '%s/images/headers/cherryblossoms.jpg', 'thumbnail_url' => '%s/images/headers/cherryblossoms-thumbnail.jpg', 'description' => __('Cherry Blossoms')), 22 'concave' => array('url' => '%s/images/headers/concave.jpg', 'thumbnail_url' => '%s/images/headers/concave-thumbnail.jpg', 'description' => __('Concave')), 23 'fern' => array('url' => '%s/images/headers/fern.jpg', 'thumbnail_url' => '%s/images/headers/fern-thumbnail.jpg', 'description' => __('Fern')), 24 'forestfloor' => array('url' => '%s/images/headers/forestfloor.jpg', 'thumbnail_url' => '%s/images/headers/forestfloor-thumbnail.jpg', 'description' => __('Forest Floor')), 25 'inkwell' => array('url' => '%s/images/headers/inkwell.jpg', 'thumbnail_url' => '%s/images/headers/inkwell-thumbnail.jpg', 'description' => __('Ink Well')), 26 'path' => array('url' => '%s/images/headers/path.jpg', 'thumbnail_url' => '%s/images/headers/path-thumbnail.jpg', 'description' => __('Path')), 27 'sunset' => array('url' => '%s/images/headers/sunset.jpg', 'thumbnail_url' => '%s/images/headers/sunset-thumbnail.jpg', 'description' => __('Sunset')) ) ); 20 register_default_headers( array ( 21 'berries' => array ( 22 'url' => '%s/images/headers/berries.jpg', 23 'thumbnail_url' => '%s/images/headers/berries-thumbnail.jpg', 24 'description' => __( 'Berries' ) 25 ), 26 'cherryblossom' => array ( 27 'url' => '%s/images/headers/cherryblossoms.jpg', 28 'thumbnail_url' => '%s/images/headers/cherryblossoms-thumbnail.jpg', 29 'description' => __( 'Cherry Blossoms' ) 30 ), 31 'concave' => array ( 32 'url' => '%s/images/headers/concave.jpg', 33 'thumbnail_url' => '%s/images/headers/concave-thumbnail.jpg', 34 'description' => __( 'Concave' ) 35 ), 36 'fern' => array ( 37 'url' => '%s/images/headers/fern.jpg', 38 'thumbnail_url' => '%s/images/headers/fern-thumbnail.jpg', 39 'description' => __( 'Fern' ) 40 ), 41 'forestfloor' => array ( 42 'url' => '%s/images/headers/forestfloor.jpg', 43 'thumbnail_url' => '%s/images/headers/forestfloor-thumbnail.jpg', 44 'description' => __( 'Forest Floor' ) 45 ), 46 'inkwell' => array ( 47 'url' => '%s/images/headers/inkwell.jpg', 48 'thumbnail_url' => '%s/images/headers/inkwell-thumbnail.jpg', 49 'description' => __( 'Ink Well' ) 50 ), 51 'path' => array ( 52 'url' => '%s/images/headers/path.jpg', 53 'thumbnail_url' => '%s/images/headers/path-thumbnail.jpg', 54 'description' => __( 'Path' ) 55 ), 56 'sunset' => array ( 57 'url' => '%s/images/headers/sunset.jpg', 58 'thumbnail_url' => '%s/images/headers/sunset-thumbnail.jpg', 59 'description' => __( 'Sunset' ) 60 ) 61 ) ); 28 62 29 63 add_custom_background(); … … 76 110 if ( ! function_exists( 'twentyten_get_page_number' ) ) : 77 111 function twentyten_get_page_number() { 78 if ( get_query_var( 'paged') )79 return ' | ' . __( 'Page ' , 'twentyten' ) . get_query_var('paged');112 if ( get_query_var( 'paged' ) ) 113 return ' | ' . __( 'Page ' , 'twentyten' ) . get_query_var( 'paged' ); 80 114 } 81 115 endif; … … 99 133 // Make a nice read more link on excerpts 100 134 if ( ! function_exists( 'twentyten_excerpt_more' ) ) : 101 function twentyten_excerpt_more( $more) {135 function twentyten_excerpt_more( $more ) { 102 136 return ' … <a href="'. get_permalink() . '">' . 'Continue reading <span class="meta-nav">→</span>' . '</a>'; 103 137 } … … 122 156 <?php endif; ?> 123 157 124 <div class="comment-meta commentmetadata"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>"><?php printf( __( '%1$s at %2$s' ), get_comment_date(), get_comment_time() ); ?></a><?php edit_comment_link( __( '(Edit)', 'twentyten' ),' ','' ); ?></div>158 <div class="comment-meta commentmetadata"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>"><?php printf( __( '%1$s at %2$s' ), get_comment_date(), get_comment_time() ); ?></a><?php edit_comment_link( __( '(Edit)', 'twentyten' ),' ','' ); ?></div> 125 159 126 160 <div class="comment-body"><?php comment_text(); ?></div> … … 148 182 if ( ! function_exists( 'twentyten_cat_list' ) ) : 149 183 function twentyten_cat_list() { 150 return twentyten_term_list( 'category', ', ', __('Posted in %s', 'twentyten'), __('Also posted in %s', 'twentyten') );184 return twentyten_term_list( 'category', ', ', __( 'Posted in %s', 'twentyten' ), __( 'Also posted in %s', 'twentyten' ) ); 151 185 } 152 186 endif; … … 154 188 if ( ! function_exists( 'twentyten_tag_list' ) ) : 155 189 function twentyten_tag_list() { 156 return twentyten_term_list( 'post_tag', ', ', __('Tagged %s', 'twentyten'), __('Also tagged %s', 'twentyten') );190 return twentyten_term_list( 'post_tag', ', ', __( 'Tagged %s', 'twentyten' ), __( 'Also tagged %s', 'twentyten' ) ); 157 191 } 158 192 endif; 159 193 160 194 if ( ! function_exists( 'twentyten_term_list' ) ) : 161 function twentyten_term_list( $taxonomy, $glue = ', ', $text = '', $also_text = '') {195 function twentyten_term_list( $taxonomy, $glue = ', ', $text = '', $also_text = '' ) { 162 196 global $wp_query, $post; 163 197 $current_term = $wp_query->get_queried_object(); 164 $terms = wp_get_object_terms( $post->ID, $taxonomy);198 $terms = wp_get_object_terms( $post->ID, $taxonomy ); 165 199 // If we're viewing a Taxonomy page.. 166 if ( isset( $current_term->taxonomy) && $taxonomy == $current_term->taxonomy ) {200 if ( isset( $current_term->taxonomy ) && $taxonomy == $current_term->taxonomy ) { 167 201 // Remove the term from display. 168 foreach ( (array) $terms as $key => $term ) {202 foreach ( (array) $terms as $key => $term ) { 169 203 if ( $term->term_id == $current_term->term_id ) { 170 unset( $terms[$key]);204 unset( $terms[$key] ); 171 205 break; 172 206 } … … 177 211 $tlist = array(); 178 212 $rel = 'category' == $taxonomy ? 'rel="category"' : 'rel="tag"'; 179 foreach ( (array) $terms as $term ) {213 foreach ( (array) $terms as $term ) { 180 214 $tlist[] = '<a href="' . get_term_link( $term, $taxonomy ) . '" title="' . esc_attr( sprintf( __( 'View all posts in %s', 'twentyten' ), $term->name ) ) . '" ' . $rel . '>' . $term->name . '</a>'; 181 215 } 182 if ( ! empty($tlist) )183 return sprintf( $text, join($glue, $tlist));216 if ( ! empty( $tlist ) ) 217 return sprintf( $text, join( $glue, $tlist ) ); 184 218 return ''; 185 219 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)