[wp-trac] [WordPress Trac] #13361: In Twenty Ten, custom excerpts do not show "Continue reading" (was: the_excerpt() not return Continuation text when return excerpt for a post)
WordPress Trac
wp-trac at lists.automattic.com
Tue May 11 21:31:28 UTC 2010
#13361: In Twenty Ten, custom excerpts do not show "Continue reading"
--------------------------+-------------------------------------------------
Reporter: pbearne | Owner: iammattthomas
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 3.0
Component: Themes | Version: 3.0
Severity: normal | Keywords:
--------------------------+-------------------------------------------------
Changes (by nacin):
* owner: => iammattthomas
* status: new => assigned
* component: Template => Themes
Old description:
> I am trying to get the_excerpt() to work on 3.0 beta 2 with 2010
>
> we have this code
> <?php if ( is_archive() || is_search() ) : // Only display Excerpts for
> archives & search ?>
> <div class="entry-summary">
> <?php the_excerpt( __( 'Continue reading
> <span class="meta-nav">→</span>', 'twentyten' ) ); ?>
> </div><!-- .entry-summary -->
> <?php else : ?>
> also
> /**
> * Sets the "read more" link to something pretty.
> *
> * To override this link in a child theme, remove the filter and add your
> own
> * function tied to the excerpt_more filter hook.
> *
> * @since 3.0.0
> * @return string A pretty 'Continue reading' link.
> */
> function twentyten_excerpt_more( $more ) {
> return ' … <a href="'. get_permalink() . '">' .
> __('Continue reading <span class="meta-nav">→</span>', 'twentyten')
> . '</a>';
> }
> add_filter( 'excerpt_more', 'twentyten_excerpt_more' );
>
> in function.php
>
> But I am not getting the "Continue reading " text and link if I enter an
> extract into the post only for the more tag ect.
New description:
The excerpt_more text is only used when an excerpt needs to be cut down in
length in wp_trim_excerpt. A custom excerpt will not get a "Continue
reading" link in Twenty Ten.
--
Comment:
Editing the title and description, and assigning to Matt Thomas.
This was brought up on one of the mailing lists a month ago as well. More
or less, as the new description indicates, the excerpt_more text isn't
used when we're handling custom excerpts. That might have been an
oversight in 2.9, but that's too late to address in 3.0.
That said, perhaps Twenty Ten should filter excerpt_more to an empty
string, then always append 'Continue Reading' on our own.
Also, there's some bad code there. the_excerpt does not take any
parameters. No matter how hard you try, it won't echo out a link the way
the_content does.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/13361#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list