Make WordPress Core

Changeset 14889


Ignore:
Timestamp:
05/25/2010 04:08:44 PM (15 years ago)
Author:
nacin
Message:

Always show 'Continue reading' link when dealing with excerpts in Twenty Ten. props iandstewart, fixes #13361.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentyten/functions.php

    r14832 r14889  
    245245
    246246/**
    247  * Sets the "read more" link to something pretty.
     247 * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis.
     248 *
     249 * To override this in a child theme, remove the filter and add your own
     250 * function tied to the excerpt_more filter hook.
     251 *
     252 * @since Twenty Ten 1.0
     253 * @return string An ellipsis
     254 */
     255function twentyten_auto_excerpt_more( $more ) {
     256    return ' …';
     257}
     258add_filter( 'excerpt_more', 'twentyten_auto_excerpt_more' );
     259
     260/**
     261 * Adds a pretty "Continue Reading" link to post excerpts.
    248262 *
    249263 * To override this link in a child theme, remove the filter and add your own
    250  * function tied to the excerpt_more filter hook.
    251  *
    252  * @since Twenty Ten 1.0
    253  * @return string A pretty 'Continue reading' link.
    254  */
    255 function twentyten_excerpt_more( $more ) {
    256     return ' &hellip; <a href="'. get_permalink() . '">' . __('Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten') . '</a>';
    257 }
    258 add_filter( 'excerpt_more', 'twentyten_excerpt_more' );
     264 * function tied to the get_the_excerpt filter hook.
     265 *
     266 * @since Twenty Ten 1.0
     267 * @return string Excerpt with a pretty "Continue Reading" link
     268 */
     269function twentyten_custom_excerpt_more( $output ) {
     270    return $output . ' <a href="'. get_permalink() . '">' . __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) . '</a>';
     271}
     272add_filter( 'get_the_excerpt', 'twentyten_custom_excerpt_more' );
    259273
    260274/**
Note: See TracChangeset for help on using the changeset viewer.