Changeset 15040 for trunk/wp-content/themes/twentyten/functions.php
- Timestamp:
- 05/28/2010 05:01:27 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/themes/twentyten/functions.php
r14955 r15040 250 250 251 251 /** 252 * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis. 252 * Returns a "Continue Reading" link for excerpts 253 * 254 * @since Twenty Ten 1.0 255 * @return string "Continue Reading" link 256 */ 257 function twentyten_continue_reading_link() { 258 return ' <a href="'. get_permalink() . '">' . __( 'Continue reading <span class="meta-nav">→</span>', 'twentyten' ) . '</a>'; 259 } 260 261 /** 262 * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and twentyten_continue_reading_link(). 253 263 * 254 264 * To override this in a child theme, remove the filter and add your own … … 259 269 */ 260 270 function twentyten_auto_excerpt_more( $more ) { 261 return ' …' ;271 return ' …' . twentyten_continue_reading_link(); 262 272 } 263 273 add_filter( 'excerpt_more', 'twentyten_auto_excerpt_more' ); 264 274 265 275 /** 266 * Adds a pretty "Continue Reading" link to post excerpts.276 * Adds a pretty "Continue Reading" link to custom post excerpts. 267 277 * 268 278 * To override this link in a child theme, remove the filter and add your own … … 273 283 */ 274 284 function twentyten_custom_excerpt_more( $output ) { 275 return $output . ' <a href="'. get_permalink() . '">' . __( 'Continue reading <span class="meta-nav">→</span>', 'twentyten' ) . '</a>'; 285 if ( has_excerpt() ) { 286 $output .= twentyten_continue_reading_link(); 287 } 288 return $output; 276 289 } 277 290 add_filter( 'get_the_excerpt', 'twentyten_custom_excerpt_more' );
Note: See TracChangeset
for help on using the changeset viewer.