apply_filters( 'excerpt_more', string $more_string )
Filters the string in the “more” link displayed after a trimmed excerpt.
Description Description
Parameters Parameters
- $more_string
-
(string) The string shown within the more link.
Source Source
Changelog Changelog
| Version | Description |
|---|---|
| 2.9.0 | Introduced. |
User Contributed Notes User Contributed Notes
You must log in before being able to contribute a note or feedback.
How To Add A “Continue Reading” Link To Excerpts
function wpdocs_excerpt_more( $more ) { return sprintf( '<a href="%1$s" class="more-link">%2$s</a>', esc_url( get_permalink( get_the_ID() ) ), sprintf( __( 'Continue reading %s', 'wpdocs' ), '<span class="screen-reader-text">' . get_the_title( get_the_ID() ) . '</span>' ) ); } add_filter( 'excerpt_more', 'wpdocs_excerpt_more' );How to replace […] by some other string?
In following code, we are replacing […] by just …
You can send any string in return.
/** * Change the excerpt more string */ function my_theme_excerpt_more( $more ) { return '…'; } add_filter( 'excerpt_more', 'my_theme_excerpt_more' );