#13361 closed defect (bug) (fixed)
In Twenty Ten, custom excerpts do not show "Continue reading"
Reported by: | pbearne | Owned by: | iandstewart |
---|---|---|---|
Milestone: | 3.0 | Priority: | normal |
Severity: | normal | Version: | 3.0 |
Component: | Themes | Keywords: | commit |
Focuses: | Cc: |
Description (last modified by )
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.
Attachments (5)
Change History (28)
#1
@
15 years ago
- Component changed from Template to Themes
- Description modified (diff)
- Owner set to iammattthomas
- Status changed from new to assigned
- Summary changed from the_excerpt() not return Continuation text when return excerpt for a post to In Twenty Ten, custom excerpts do not show "Continue reading"
#2
follow-up:
↓ 3
@
15 years ago
that code came from the 2010 theme
I feel that this needs to the_excerpt should work the same as the_content
#3
in reply to:
↑ 2
;
follow-up:
↓ 4
@
15 years ago
Replying to pbearne:
that code came from the 2010 theme
I know. And it's wrong.
I feel that this needs to the_excerpt should work the same as the_content
That's not going to happen for 3.0, if ever (the_excerpt's first argument is deprecated, so we can't use it).
#4
in reply to:
↑ 3
@
15 years ago
Replying to nacin:
Replying to pbearne:
that code came from the 2010 theme
I know. And it's wrong.
I feel that this needs to the_excerpt should work the same as the_content
That's not going to happen for 3.0, if ever (the_excerpt's first argument is deprecated, so we can't use it).
thanks for the reply I guess it better be done as a function call
#5
@
15 years ago
add this to the function.php and we get the more link added to extracts
function twentyten_excerpt( $more ) { // return $more.' … <a href="'. get_permalink() . '">' . __('Continue reading <span class="meta-nav">→</span>', 'twentyten') . '</a>'; } add_filter( 'the_excerpt', 'twentyten_excerpt' );
#6
@
15 years ago
this is also broken in the RSS feeds
the_excerpt's first argument is deprecated in 2.3 its likly that is safe to reuse this. I would like to suggeest that do that so that it behave the same way as the get_post
#7
@
15 years ago
If the excerpt_more filter is only intended to filter the '[…]' of trimmed content I'm inclined to roll with the default behavior rather than have Twenty Ten get any more complicated.
#8
@
15 years ago
Correct, that's all excerpt_more is intended to do.
It's been pointed out on wp-testers or hackers that this is inconsistent, and I agree. We should either pull it, or enhance it. I think I'm for enhancing it for consistency, otherwise you get that goofy [...] we all love to hate.
We might even be able to do it with one function attached to both hooks.
#9
@
15 years ago
- Owner changed from iammattthomas to iandstewart
Talked to Ian and he's going to own this one, as he knows a lot more about Twenty Ten's functions than I do.
@
15 years ago
Filter the traditional "[…]" in excerpts with an empty string and adds a fancy "Continue reading link" to both trimmed excerpts AND custom excerpts.
@
15 years ago
Filter excerpt_more and--if there's a custom excerpt--filter get_the_excerpt to add a pretty "Continue reading" link to trimmed excerpts AND custom excerpts but NOT posts less than the excerpt length.
#11
@
15 years ago
Reviewing this. Looks good. Think it would be cool to do both with one function, but that would require a current_filter call it seems to prevent two "Continue reading" links.
Actually, after a pretty excerpt you'd still get '...' before you then get "Continue reading." Maybe we force "" through excerpt_more, then check for false == has_excerpt in order to decide whether to add '...'? Then we're also not using the string in two locations.
Going to play with this.
#13
@
15 years ago
Okay. Tested with a custom excerpt and auto-generated excerpts (both truncated and untruncated). You always get 'Continue reading...' and if it was a truncated auto-generated excerpt, you also get an ellipsis.
Thanks Ian!
#14
@
15 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
After IRC discussion with Ian a few days ago and now #13588, I want to ponder this some more.
#15
@
15 years ago
@nacin — Your commit caught that custom excerpts wouldn't need an ellipsis. Good catch.
@
15 years ago
Generate a "Continue Reading" link, filter excerpt_more and--if there's a custom excerpt--filter get_the_excerpt to add our generated link to trimmed excerpts AND custom excerpts but NOT posts less than the excerpt length.
#16
@
15 years ago
For reference, the expected result of cautiously_fancy_excerpts.diff …
http://img.skitch.com/20100528-fpdwxinhncap6g1s31ewhc53is.jpg
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.